phone format
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@48 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -141,6 +141,16 @@ class Format
|
|||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function phone2int($phone)
|
||||||
|
{
|
||||||
|
$phone = str_replace(array(' ','-','(',')'), '', $phone);
|
||||||
|
$phone_length = strlen($phone);
|
||||||
|
if (is_numeric($phone) && ($phone_length == 7 || $phone_length == 10)) { //бывают семизначные прямые номера
|
||||||
|
return $phone;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Format::setTimezoneOffset(date('Z'));
|
Format::setTimezoneOffset(date('Z'));
|
||||||
|
Reference in New Issue
Block a user