本文整理汇总了PHP中DataValidator::cc_number_exists_in_str方法的典型用法代码示例。如果您正苦于以下问题:PHP DataValidator::cc_number_exists_in_str方法的具体用法?PHP DataValidator::cc_number_exists_in_str怎么用?PHP DataValidator::cc_number_exists_in_str使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataValidator
的用法示例。
在下文中一共展示了DataValidator::cc_number_exists_in_str方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLuhnCheck
/**
* Test the Luhn check algorithm
* @dataProvider luhnDataProvider
*/
public function testLuhnCheck($number, $expresult, $helpful_message)
{
$result = DataValidator::cc_number_exists_in_str($number);
$this->assertEquals($expresult, $result, "{$number} failed expected luhn check ({$helpful_message})");
}
示例2: validateEmail
static function validateEmail($email)
{
$isEmail = filter_var($email, FILTER_VALIDATE_EMAIL);
$isEmail = $isEmail && !DataValidator::cc_number_exists_in_str($email);
return $isEmail;
}
示例3: validate_address
/**
* Gets rid of numbers that pass luhn in address fields - @see validate_name
* @param $value
* @return bool True if suspiciously like a CC number
*/
public static function validate_address($value)
{
return !DataValidator::cc_number_exists_in_str($value);
}