Better way to load evaluated PHP XML file?
Posted: Fri Oct 19, 2012 7:31 pm
Is there a better way to do this?
I'm looping back in order to load a PHP file that generates XML.
Example: "testxml.php" file contains something like:
The 127.0.0.1 is adding unnecessary load time, if I'm not mistaken.
Code: Select all
<?php
$feed = simplexml_load_file('http://127.0.0.1/testxml.php');
echo $feed->test;
?>Example: "testxml.php" file contains something like:
Code: Select all
<?php
header('Content-Type: application/xml');
echo '<?xml version="1.0" encoding="UTF-8" ?>';
?>
<content>
<test><?php for ($i = 0; $i < 10; $i++) echo $i . ''; ?></test>
</content>