int2phone function added
git-svn-id: svn+ssh://code.netmonsters.ru/svn/majestic/trunk@46 4cb57b5f-5bbd-dd11-951b-001d605cbbc5
This commit is contained in:
@ -21,7 +21,7 @@ class Format
|
|||||||
/* Date & time */
|
/* Date & time */
|
||||||
static protected $time_format = 'H:i:s';
|
static protected $time_format = 'H:i:s';
|
||||||
static protected $date_format = 'd.m.Y';
|
static protected $date_format = 'd.m.Y';
|
||||||
static protected $date_time_format = 'd.m.Y H:i';
|
static protected $date_time_format = 'H:i d.m.Y';
|
||||||
static protected $timezone_offset = 0;
|
static protected $timezone_offset = 0;
|
||||||
static protected $cache_time = array();
|
static protected $cache_time = array();
|
||||||
|
|
||||||
@ -129,6 +129,18 @@ class Format
|
|||||||
}
|
}
|
||||||
return self::$cache_time[$time];
|
return self::$cache_time[$time];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function int2phone($intphone)
|
||||||
|
{
|
||||||
|
$intphone = (string) $intphone;
|
||||||
|
|
||||||
|
if (strlen($intphone) == 10) {
|
||||||
|
return '('.substr($intphone, 0, 3).') '.substr($intphone, 3, 3).'-'.substr($intphone, 6, 2).'-'.substr($intphone, 8, 2);
|
||||||
|
} elseif (strlen($intphone) == 7) {
|
||||||
|
return substr($intphone, 0, 3).'-'.substr($intphone, 3, 2).'-'.substr($intphone, 5, 2);
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Format::setTimezoneOffset(date('Z'));
|
Format::setTimezoneOffset(date('Z'));
|
||||||
|
Reference in New Issue
Block a user