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;
Mike Oshadami
  • 341
  • 1
  • 3
  • 4

1 Answers1

0

try this.

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

and so on...

Mian Waqas
  • 25
  • 4