views:

352

answers:

2

i store my article in a xml file, so if i write into it special characters "' xml automatically escapes this characters and when i get(via PHP) the xml content i get something like \". so if i write into xml "hello dude" my html will look like this \"hello dude\" how can i get the xml content like it was initially inserted("hello dude")? thanks

+1  A: 

You haven't specified how you are reading or outputting the data, but neither HTML nor XML use the \ character to escape anything.

You might have magic quotes turned on. I'd suggest turning it off, as it isn't very effective. You can hack around it with stripslashes.

David Dorward
A: 

html_entity_decode() takes an html-encoded strings and removes escaping (e.g., &lt; into <).

stripslashes() unescapes slashes (e.g. \' into ').

Tordek