PHP: preg_replace help

ArkInRev

New Member
I have the following code:\[code\]$string = 'http://google.com';$bbreplace = array ('/\[url\](.+?)\[\/url\]/');$bbreplacements = array ('<a href=http://stackoverflow.com/"\\1\">\\1</a>');$string = preg_replace($bbreplace, $bbreplacements, $string);print $string;\[/code\]Which creates a url called http://google.com/ that points to\[code\]mydomain.com/"http://google.com/" \[/code\]instead of\[code\]http://google.com/\[/code\]How can I fix this? Thanks
 
Back
Top