Created
October 26, 2016 08:59
-
-
Save berliozd/80931874ea8c9e87af9115d428511dd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Format phone number as 0111111111 (replace +33 or 33 by 0) | |
* | |
* @param $countryId | |
* @param $phone | |
* @return mixed | |
*/ | |
protected function _formatPhone($countryId, $phone) | |
{ | |
if ($countryId === 'FR') { | |
$phone = preg_replace('/^(\+?(00)?33)/', '0', $phone); | |
} | |
return $phone; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment