How to perform case-insensitive search in a regular expression with preg_match in PHP

1 Answer

0 votes
// 'i' after the pattern delimiter mean case-insensitive search

preg_match("/php/", "Develop web application with PHP"); // return false (0)
preg_match("/php/i", "Develop web application with PHP"); // return true (1) 


answered May 12, 2014 by avibootz
edited May 12, 2014 by avibootz

Related questions

1 answer 190 views
1 answer 84 views
1 answer 99 views
1 answer 99 views
1 answer 102 views
1 answer 161 views
...