dcc202fb249a446ac15c7cf413b9f1b4a3f31b58
Bernd Wurst Nummercheck ausgelagert und...

Bernd Wurst authored 6 years ago

1) <?php
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst Nummercheck ausgelagert und...

Bernd Wurst authored 6 years ago

6)   Bernd Wurst <bernd@schokokeks.org>
7)   Hanno Böck <hanno@schokokeks.org>
8) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst Nummercheck ausgelagert und...

Bernd Wurst authored 6 years ago

10) 
11) Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code.
12) */
13) 
14) require_once('vendor/autoload.php');
15) 
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

16) function format_number($number, $country)
17) {
Bernd Wurst Nummercheck ausgelagert und...

Bernd Wurst authored 6 years ago

18)     $phoneNumberUtil = \libphonenumber\PhoneNumberUtil::getInstance();
19)     try {
20)         $phoneNumber = $phoneNumberUtil->parse($number, $country);
21)     } catch (Exception $e) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

22)         return null;
Bernd Wurst Nummercheck ausgelagert und...

Bernd Wurst authored 6 years ago

23)     }
24)     if ($phoneNumberUtil->isValidNumber($phoneNumber)) {
25)         return $phoneNumberUtil->format($phoneNumber, 1);
26)     }
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

27)     return null;