本文整理匯總了PHP中Zend_Filter::isCcnum方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Filter::isCcnum方法的具體用法?PHP Zend_Filter::isCcnum怎麽用?PHP Zend_Filter::isCcnum使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Filter
的用法示例。
在下文中一共展示了Zend_Filter::isCcnum方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testIsCCNum
public function testIsCCNum()
{
$this->assertTrue(Zend_Filter::isCcnum('4929000000006'), '"4929000000006" is a valid Visa cc num.');
$this->assertTrue(Zend_Filter::isCcnum('5404000000000001'), '"5404000000000001" is a valid Mastercard cc num.');
$this->assertTrue(Zend_Filter::isCcnum('374200000000004'), '"374200000000004" is a valid Amex cc num.');
$this->assertFalse(Zend_Filter::isCcnum('4444555566667777'), '"4444555566667777" is not a valid cc num.');
$this->assertFalse(Zend_Filter::isCcnum('ABCDEF'), '"ABCDEF" is not a valid cc num.');
}
示例2: testCcnum
/**
* Returns value if it is a valid credit card number format. The
* optional second argument allows developers to indicate the
* type.
*
* @param mixed $key
* @param mixed $type
* @return mixed
*/
public function testCcnum($key, $type = NULL)
{
if (!$this->keyExists($key)) {
return false;
}
if (Zend_Filter::isCcnum($this->_source[$key], $type)) {
return $this->_source[$key];
}
return FALSE;
}
示例3: testCcnum
/**
* Returns value if it is a valid credit card number format. The
* optional second argument allows developers to indicate the
* type.
*
* @param mixed $key
* @param mixed $type
* @return mixed
*/
public function testCcnum($key = null, $type = NULL)
{
if (!($value = $this->keyExists($key))) {
return false;
}
if (Zend_Filter::isCcnum($value, $type)) {
return $value;
}
return FALSE;
}
示例4: isCcnum
/**
* Returns value if it is a valid credit card number format. The
* optional second argument allows developers to indicate the
* type.
*
* @param mixed $key
* @param mixed $type
* @return mixed
*/
public function isCcnum($key, $type = NULL)
{
return Zend_Filter::isCcnum($this->_source[$key], $type);
}
示例5: testCcnum
/**
* Returns value if it is a valid credit card number format. The
* optional second argument allows developers to indicate the
* type.
*
* @deprecated since 0.8.0
* @param mixed $key
* @return mixed
*/
public function testCcnum($key)
{
if (!$this->keyExists($key)) {
return false;
}
if (Zend_Filter::isCcnum($this->_source[$key])) {
return $this->_source[$key];
}
return false;
}