Hi I\'m trying to convert the XML file into associative array by using the following code
$xmlUrl = \'../products.xml\';
$xmlStr = file_get_contents($xmlUrl)
This is probably caused by magic_quotes_runtime adding backslashes when you call file_get_contents. Try the following:
$xmlUrl = '../products.xml';
$xmlStr = file_get_contents($xmlUrl);
if (get_magic_quotes_runtime())
{
$xmlStr = stripslashes($xmlStr);
}
$xmlObj = simplexml_load_string($xmlStr); print_r ($xmlObj);exit;
$arrXml = objectsIntoArray($xmlObj); $xmlStr = file_get_contents($xmlUrl);
Alternatively you could disable magic_quotes_runtime (although this may have effects elsewhere in your script) in your PHP configuration, via .htaccess, or by adding the following near the top of your script:
set_magic_quotes_runtime(false);