本文整理匯總了PHP中Zend_Filter::isPhone方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Filter::isPhone方法的具體用法?PHP Zend_Filter::isPhone怎麽用?PHP Zend_Filter::isPhone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Filter
的用法示例。
在下文中一共展示了Zend_Filter::isPhone方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testPhone
/**
* Returns value if it is a valid phone number format, FALSE
* otherwise. The optional second argument indicates the country.
*
* @param mixed $key
* @return mixed
*/
public function testPhone($key, $country = 'US')
{
if (!$this->keyExists($key)) {
return false;
}
if (Zend_Filter::isPhone($this->_source[$key], $country)) {
return $this->_source[$key];
}
return FALSE;
}
示例2: isPhone
/**
* Returns value if it is a valid phone number format, FALSE
* otherwise. The optional second argument indicates the country.
*
* @param mixed $key
* @return mixed
*/
public function isPhone($key, $country = 'US')
{
return Zend_Filter::isPhone($this->_source[$key], $country);
}
示例3: testisPhone
public function testisPhone()
{
$this->assertTrue(Zend_Filter::isPhone('6134123456'), '"6134123456" is a US Phone number');
$this->assertFalse(Zend_Filter::isPhone('1004123456'), '"100123456" is not a valid US Phone number');
}
示例4: testPhone
/**
* Returns value if it is a valid phone number format, FALSE
* otherwise. The optional second argument indicates the country.
*
* @param mixed $key
* @return mixed
*/
public function testPhone($key = null, $country = 'US')
{
if (!($value = $this->keyExists($key))) {
return false;
}
if (Zend_Filter::isPhone($value, $country)) {
return $value;
}
return FALSE;
}