Jump to content

SimpleXML and stripslashes


tracivia

Recommended Posts

Hi everybody,

 

first i like to mention, i might be forgotten to provide enough information or misunderstood the needed information.

 

I have a PHP scripts which gets an XML feed from an external service. The feed comes with slashes and i use stripslashes function to remove slashes. When i use the script with and local XML file, it works perfect. When i use the external service with stripslashes($_POST['data']), i am having troubles sometimes. %80 of the feed is fetched correctly tough. I don't use any ini set, magic quotes set on, and magic sybase is off. Server is Debian and my local pc is windows. It works perfect on both servers in case i don't use stripslashes. what could be the problem? Thanks in advance.

 

P.S. i've analyzed this problem and just removing stripslashes solves the problem.

 

$xml_str = stripslashes(trim($_POST['data'])); //doesn't work
$xml_str = file_get_contents('sample.xml'); //works

Link to comment
https://forums.phpfreaks.com/topic/149849-simplexml-and-stripslashes/
Share on other sites

i don't mean that my problem is solved, i have to remove those slashes since i can't modify the data coming from the service. I should say, the reason of the problem instead of "removing stripslashes solves the problem", but i couldn't find the button to edit my message.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.