I'm having trouble getting PHP's SimpleXML to work with our XML feed. I'm just calling the title attribute for simplification. When I run any of this code it only exports empty h3 tags. Any help is greatly appreciated.
I've tried this:
<?php
$xml = simplexml_load_file('http://events.stanford.edu/xml/mobile.xml');
foreach($xml as $event){
echo '<h3>', $event['title'], '</h3>';
}
?>
...and this:
<?php
$xml = simplexml_load_file('http://events.stanford.edu/xml/mobile.xml');
foreach($xml->Event as $event){
echo '<h3>', $event['title'], '</h3>';
}
?>
...and this:
<?php
$xml = simplexml_load_file('http://events.stanford.edu/xml/mobile.xml');
foreach($xml as $node){
echo '<h3>', $node['title'], '</h3>';
}
?>