function format_fr_phone_number in Phone 7
Same name and namespace in other branches
- 5 phone.fr.inc \format_fr_phone_number()
- 6 phone.fr.inc \format_fr_phone_number()
Formatting for French Phone Numbers.
Parameters
string $phonenumber:
Return value
string Returns a string containting the phone number with some formatting.
1 call to format_fr_phone_number()
File
- include/
phone.fr.inc, line 39 - CCK Field for French phone numbers.
Code
function format_fr_phone_number($phonenumber, $field = FALSE) {
$phone = str_replace(array(
' ',
'-',
'(',
')',
), '', $phonenumber);
if (preg_match(PHONE_FR_REGEX, $phone, $matches) != 1) {
return $phonenumber;
// not a french phone number
}
return ($field && $field['phone_country_code'] ? '+33 ' : '0') . $matches[2];
}