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 185 views
1 answer 77 views
1 answer 93 views
1 answer 94 views
1 answer 95 views
1 answer 152 views
...