trying to match the following:
rawurl="http://www.domain.com/page/etc/"
the URL itself is variable and could contain all sorts! ? querystrings and more. Is there an escape function to make it regex safe?
so I have this so far
$var is already defined..
$url = "www.adomain.com/with/extras/"
$url = str_replace(" \/ ","/",$url); // maybe more needed here.
$pattern = "/rawurl\=\"http\:\/\/$url/";
preg_match($pattern, $var, $out);
having problems formatting t开发者_如何学Che regex correctly, have been going cross eyed now for several hours. Any help appreciated...
Take a look at preg_quote
精彩评论