string validationTotal 2 articles
PHP checks whether a pure number - Seven Notes

PHP checks if the number is a plain number

The first: directly use a function, is_numeric() This function is to detect whether the parameter is a number, if so, return true, if not, return false, for example: is\_numeric( 'abcd123' ) ordie('the provided parameter is not a number'); The second ...
2 years ago
026514
PHP commonly used variables string checksum rules-Small seven notes

PHP common variable string checksum rules

1, check cell phone number /** * Determine whether the phone format is correct * @param $mobile */ function is_mobile($mobile) { return preg_match('/1[3456789]{1}\d{9}$/',$mobile); } /** * Verify the format of the cell phone * @param $utfstr...
2 years ago
02335