php tutorial url, date, ip, email address detection class code This article provides a really regular expression to detect url address, date format, ip address, and e-mail address is valid verification code.
function check_date ($ date, $ format = "dd / mm / yy") {// check a date if (! preg_match ("/ ([0-9] +) ([./-]) ([0-9] +) (2) ([0-9] +) /", $ date, $ m) ) return false; $ f = explode ("/", $ format); $ d [$ f [0]] = $ m [1]; $ d [$ f [1]] = $ m [3]; $ d [$ f [2]] = $ m [5]; return checkdate ($ d ['mm'], $ d ['dd'], $ d ['yyyy']. $ d ['yy']); }
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.