I need this php code changed to preg_match please
if(eregi("someurl",$data))
I need this php code changed to preg_match please
if(eregi("someurl",$data))
if (preg_match('~someurl~i', $data))
. Delimiters can be any single character — I've used ~
instead of /
used in examples on PHP site, because if you're putting URL in there, you'd have to escape /
. i
after the second delimiter is a flag triggering case-insensitivity — PCRE doesn't have separate functions for that.