KingOfHeart Posted February 27, 2011 Share Posted February 27, 2011 function HTMLToBBCode($message) { $html = array( '/\<span class="ozentity">/' => "[color=#E25500]", '/\<span class="ozkey">/' => "[color=#0000FF]", '/\<span class="ozquote">/' => "[color=#303030]", '/\</span>/' => "[/color]", ); $message = preg_replace(array_keys($html), array_values($html), $message);//line 27 return $message; } Warning: preg_replace() [function.preg-replace]: Unknown modifier 'p' in /home/thegamin/public_html/openzelda/Admin/ozcode.php on line 27 So what mistake did I make? Quote Link to comment https://forums.phpfreaks.com/topic/229070-what-did-i-do-wrong/ Share on other sites More sharing options...
.josh Posted February 28, 2011 Share Posted February 28, 2011 since you are using / as the pattern delimiter, you need to escape the / in </span> in your last array key. Quote Link to comment https://forums.phpfreaks.com/topic/229070-what-did-i-do-wrong/#findComment-1180591 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.