Forum Moderators: coopster

Message Too Old, No Replies

SimpleXML var dump

         

Ahkamden

11:15 pm on Feb 16, 2010 (gmt 0)

10+ Year Member



I'm using simplexml_load_string(file_get_contents($test)) to pull a REST. Now I'm stuck, I'm using var_dump to try and see if it's at least working but it keeps returning object(SimpleXMLElement)#1 (0) {

When I access the URL directly the xml is there, and I ran it against a validator and it came up ok. Also I wrote a very basic XML file uploaded that to server and ran a simple php script(using load_file instead of load_string though) but it returns object(SimpleXMLElement)#1 (4) { example data }

I can't figure out what I'm doing wrong.

coopster

1:49 pm on Feb 26, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Did you ever figure out this issue, Ahkamden? Perhaps it is the file_get_contents() function that is failing. Maybe split the two functions into separate lines and check the value first.
$temp = file_get_contents($test); 
var_dump($temp);
simplexml_load_string($temp);