arianhojat Posted October 16, 2006 Share Posted October 16, 2006 i tried something like this...[code]$xml = simplexml_load_file('dynamicXML.php') or die ("Unable to load XML file!"); $yearEnd = $xml->someNode;[/code]i get a 'Unable to load XML file'. yet going to dynamicXML.php in my web browser returns a good xml result. any ideas? tried searching for loading dynamic xml into php, but couldnt find any articles suprisingly, is simplexml the way to go here? or do i have to serialize(dynamicXML.php) it into a variable before loading it with simplexml?Thanks in advance,Arian Link to comment https://forums.phpfreaks.com/topic/24109-loading-dynamic-xml-created-from-a-php-file-into-php-w-simplexml_load/ Share on other sites More sharing options...
rune_sm Posted October 16, 2006 Share Posted October 16, 2006 You have to use the load_string command if it's not an XML file.... Take a look at the example at the php.net site:http://dk2.php.net/simplexml Link to comment https://forums.phpfreaks.com/topic/24109-loading-dynamic-xml-created-from-a-php-file-into-php-w-simplexml_load/#findComment-109585 Share on other sites More sharing options...
arianhojat Posted October 16, 2006 Author Share Posted October 16, 2006 Hey rune_sm,is this still the case when the webpage has a header of text/xml? can i just pass the php filename to load_string?or do i have to do any special functions on the file, somehow convert it to soemthing liek a file_get_contents be4hand? Link to comment https://forums.phpfreaks.com/topic/24109-loading-dynamic-xml-created-from-a-php-file-into-php-w-simplexml_load/#findComment-109653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.