You are here

function format_it_phone_number in Phone 5

Same name and namespace in other branches
  1. 6 phone.it.inc \format_it_phone_number()
  2. 7 include/phone.it.inc \format_it_phone_number()

Formatting for Italian Phone Numbers.

Parameters

string $phonenumber:

Return value

string Returns a string containting the phone number with some formatting.

File

./phone.it.inc, line 23

Code

function format_it_phone_number($phonenumber, $field) {

  //$phonenumber = trim($phonenumber);

  // do some formatting on the phone number
  $phonenumber = str_replace("[ -]", "", $phonenumber);
  if ($field['phone_country_code']) {
    if ($matches[1] != "+39") {
      $phonenumber = "+39" . " " . $phonenumber;
    }
  }
  return $phonenumber;
}