Quote:
Originally Posted by Killswitch
I get the same error as nation-x, I had to remove the http:\/\/ from the regex as it's already in the database as having it, but I even str_replace'd it and still get the error.
|
Hm.. this works for me, did you double escape so that both \/ show?
Code:
$uri = 'http://www.bing.com/';
$uri = str_replace( '/', '\\/', $uri );
$back = 'bing';
preg_match_all("/<a\s[^>]*href=([\"\']??)({$uri}*?)([\"\']??)[^>]*>({$back})<\/a>/siU", $links, $matches);
print_r( $matches );