mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-21 00:46:27 +02:00
Gestion international
This commit is contained in:
parent
b6251213ba
commit
e95ea78547
3 changed files with 4 additions and 4 deletions
|
@ -8,8 +8,8 @@
|
|||
*/
|
||||
public static function parsePhone($number)
|
||||
{
|
||||
$number = preg_replace('#[^0-9+]#', '', $number);
|
||||
if (preg_match('#^(0|\+33)[1-9][0-9]{8}$#', $number))
|
||||
$number = preg_replace('#[^-0-9+]#', '', $number);
|
||||
if (preg_match('#^(0|\+[1-9]{1,3}|\+1\-[0-9]{3})[1-9][0-9]{8}$#', $number))
|
||||
{
|
||||
return $number;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue