0

I am trying to read the content of this xml url into my php code but it is failing. But if I go to the XML url directly on the browser (http://www.w3schools.com/Php/note.xml) it shows, Here is my code :

  $xml=simplexml_load_string("http://www.w3schools.com/Php/note.xml") or die("Error: Fail to Load Xml");
  echo $xml->to . "<br>";
  echo $xml->from . "<br>";
  echo $xml->heading . "<br>";
  echo $xml->body;
1

1 Answer 1

0

try this.

$xml->{"to"}
$xml->{"from"}
$xml->{"heading"}
$xml->{"body"}

and so on...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.