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? 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. 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
Archived
This topic is now archived and is closed to further replies.