XML : Loading XML file in PHP using physical path

I am getting an error on trying to load a XML file using PHP when I use the Physical path of the file. When the XML file is located in the same directory as code file I do not get a problem. Code is given below

  <?php  $xml=simplexml_load_file(realpath('D:\XML\req.xml')) or die("Error: Cannot create object");  print_r($xml);  ?>    

Any help will be appreciated.

Regards, Rahul

No comments:

Post a Comment