随笔分类 -  正则表达式

正则
摘要:*/ private static $_rules = array( 'email' => '/^[a-z0-9]+[._\-\+]*@([a-z0-9]+[-a-z0-9]*\.)+[a-z0-9]+$/', 'url' => '/^(http|https):\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=... 阅读全文
posted @ 2019-04-25 10:03 _Eternity味道 阅读(280) 评论(0) 推荐(0)
摘要:电话号码格式化 电话号码格式化 PHP代码: function format_phone($phone) { $phone = preg_replace("/[^0-9]/", "", $phone); if(strlen($phone) == 7) return preg_replace("/([ 阅读全文
posted @ 2017-08-25 09:45 _Eternity味道 阅读(638) 评论(0) 推荐(0)