author:咔咔
wechat:fangkangfk
preg_match函数是进行正则表达式的匹配,成功返回1,否则返回0
参数说明:
public function index() { if (preg_match("/php/i", "PHP is the web scripting language of choice.", $matches)) { print "A match was found:" . $matches[0]; } else { print "A match was not found."; } }
在这个正则里边有一个参数是i,这个在正则表达式里边是不区分大小写的一个参数
输出结果: