Roee Posted July 19, 2006 Share Posted July 19, 2006 hii tried to write this:[code]$content = $_POST['content']; $match = array('#\[PHP\](.*?)\[\/PHP\]#se'); $replace = array("'<div style=\"margin:25px; margin-top:5px\"><div class=\"smallfont\" style=\"margin-bottom:2px\">PHP code:</div><div class=\"alt2\" style=\"margin:0px; padding:6px; border:1px inset; overflow:auto\"><code style=\"white-space:nowrap\"><div dir=\"ltr\" style=\"text-align:left;\">'.highlight_string(stripslashes('$1'), true).'</div></code></div></div>'"); $content = preg_replace($match, $replace, $content);[/code]but if i try to write a " it makes mysql error:[b]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\' (ASCII=92) state=1[/b]why?thanks Link to comment https://forums.phpfreaks.com/topic/15058-highlight_stirng-with-preg_replace/ Share on other sites More sharing options...
Roee Posted July 20, 2006 Author Share Posted July 20, 2006 help!! Link to comment https://forums.phpfreaks.com/topic/15058-highlight_stirng-with-preg_replace/#findComment-60887 Share on other sites More sharing options...
ryanlwh Posted July 20, 2006 Share Posted July 20, 2006 it's a mysql error, not php error... Link to comment https://forums.phpfreaks.com/topic/15058-highlight_stirng-with-preg_replace/#findComment-61322 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.