First of all i'm not an preg expert yet, so here's my problem. In PHP magic quotes is enabled however if i submit a form with quotes (single and double) then when i print it back into the form you see trailing backslashes.. I'm using preg_replace to fix it, however i'm doing it in 2 lines of code as where i am sure i can use only one line of code.. Can anyone help me? Here's what i have
Code: Select all
$test=preg_replace('[\\\"]',""",$_POST["searchname"]);
$test=preg_replace('[\\\]',"",$test);Printing it back into a textbox gives the exact same result: "aaa" 'aaa' aaaa
So that's good, but i want to do it with only 1 line of code. Hope it's possible?
Thanks....