Add the format number to destinations list and adjust the function to only process numeric.

This commit is contained in:
Mark Crane
2015-05-05 04:50:23 +00:00
parent 45590912eb
commit 2b7fa564de
2 changed files with 10 additions and 8 deletions

View File

@@ -771,13 +771,15 @@ function format_string ($format, $data) {
//get the format and use it to format the phone number
function format_phone($phone_number) {
foreach ($_SESSION["format"]["phone"] as &$format) {
$format_count = substr_count($format, 'x');
$format_count = $format_count + substr_count($format, 'R');
$format_count = $format_count + substr_count($format, 'r');
if ($format_count == strlen($phone_number)) {
//format the number
$phone_number = format_string($format, $phone_number);
if (is_numeric($phone_number)) {
foreach ($_SESSION["format"]["phone"] as &$format) {
$format_count = substr_count($format, 'x');
$format_count = $format_count + substr_count($format, 'R');
$format_count = $format_count + substr_count($format, 'r');
if ($format_count == strlen($phone_number)) {
//format the number
$phone_number = format_string($format, $phone_number);
}
}
}
return $phone_number;