You are here

function _pl_formatter in Phone Number 6

Same name and namespace in other branches
  1. 7 includes/phone.pl.inc \_pl_formatter()

Helper for formatting output. Output as +48 (AA) BBB CCCC

2 calls to _pl_formatter()
pl_formatter_default in includes/phone.pl.inc
Default formatter for international phone number.
pl_formatter_local in includes/phone.pl.inc
Local formatter for local phone number.

File

includes/phone.pl.inc, line 42
CCK Field for Polish phone numbers.

Code

function _pl_formatter($element) {
  $phone = '';
  $regex = _pl_regex();
  $result = preg_match($regex, $element['number'], $matches);
  if ($result) {
    $phone = '(' . $matches[1] . ') ' . $matches[2] . ' ' . $matches[3];
  }
  return $phone;
}