本文整理汇总了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;
}