Hi,
Here is the situation:
In my php code I’m building a javascript array, each item of the array has html code from a textarea.
Before saving a new item to the array i need to replace all " with \"
I do this with the following instruction:
$news = ereg_replace( "[\"]", '\"', $_POST[‘NEWS’]);
The problem:
When a edit a item of the array, I need to execute the above instruction again to replace the " , but then the places where \" already exists, it becames \”
So now, i need to replace \” with \” or replace \ with . See the following example:
Add the following code to the array: <a href="file.php">link to file</a>
Execute the instruction: $news = ereg_replace( "[\"]", '\"', $_POST[‘NEWS’]);
The code that goes to the array is: <a href=\"file.php\">link to file</a>
Now I edit the above code, add some information and now I need to replace the " with \" again.
Execute the instruction: $news = ereg_replace( "[\"]", '\"', $_POST[‘NEWS’]);
The new code: <a href=\"file.php\">link to file</a>
So now I need to replace \" with \" I tried some ereg_replace instruciotns, but no luck, need some help, please.
Thank you.
ps: sorry my English