a123123 Posted June 22, 2012 Share Posted June 22, 2012 I have problem with this code: <?php $patterns = array('/(?<=\s)(\s|,|\+|frac|cdot|begin|cases|end|\^|\(|\)|\[|\]|\{|\}|\d|\-|\=|(?<=\+|\-|\=)(a|e|i|o|u|y)|b|c|d|f|g|h|j|k|l|m|n|p|r|s|t(?!ex)|(?<!te)x|B|C|D|F|G|H|J|K|L|M|N|P|R|S|T|X|.\(.\)|^\[t\]|^\[\/t\])+(?=(\s|,|\.|\?|\!|\(??!\[\/tex\]).|\n)*\[t\])/'); $replacements = array('($1)'); $string=$_POST['kod']; echo preg_replace($patterns, $replacements, $string); ?> Why it changes one backslash: \ into two: \\? Thanks for answer. Quote Link to comment Share on other sites More sharing options...
.josh Posted June 22, 2012 Share Posted June 22, 2012 php is probably configured to have magic quotes enabled. You can check by using get_magic_quotes_gpc. If it returns true, use stripslashes() to remove it (see the example and user notes in the get_magic_quotes_pgc() entry) Quote Link to comment Share on other sites More sharing options...
a123123 Posted June 22, 2012 Author Share Posted June 22, 2012 It was very helpless for me, I've done it and the problem is solved thank you very much sorry for my English where I can mark that the topic is solved? I remember that here used to be such an option Quote Link to comment 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.