I NEED HELP! I\'m trying to generate XML document from my website database in hosting provider and accessing it from my home PC, right now I\'m doing it in localhost environment
Your print_r($dataxml = simplexml_load_file('data.php'));
is reading you raw PHP file, not the script execution result!
data.php
file have a PHP code that outputs a XML file, not a really XML file.
You should use print_r($dataxml = simplexml_load_file('http://localhost/data.php'));
for example. (Assuming that http://localhost/data.php
is the url to access your file.)
using only 'data.php' as parameter will get the raw file from server, not processed by PHP.