I am trying to parse an xml document using php simplexml_load_file() function.
I have a demo.xml file in the site root
demo.xml
<?xml version="1.0"encoding="UTF-8" ?>
<sms>
<sender>foo bar</sender>
<sentto>john doe</sentto>
</sms>
And I am trying to get the value of sender , the following is my php code :
<?php
$xml=simplexml_load_file("demo.xml");
echo $xml->sender;
But I am getting the parser error whenever i try to load the php file.
Parser error : blank needed here in www/htdocs/read.php on line 3.
How can I solve it?
Thanks ,SK.