Results 1 to 2 of 2
Aug 25, 2011, 21:37 #1
PHP Regexp replace all question marks before a slash
I've been struggling with this tricky REGEXP replace..
Basically, I want to replace all question marks with an @ symbol that appear BEFORE a slash. Only the ones that appear before the slash, leaving the ones that appear after the slash untouched.
Aug 25, 2011, 22:02 #2
Nevermind guys. I figured it out finally, sorry!
$string = preg_replace(/\?(?=.*\/)/i,'@',$string)