<?php
// load SimpleXML
$entry = new SimpleXMLElement('http://bit.ly/c3IqMF', null, true);
echo <<<EOF
<table>
<tr>
<th>Title</th>
<th>Image</th>
</tr>
EOF;
foreach($entry as $item) //
{
echo <<<EOF
<tr>
<td>{$item->title}</td>
<td><img src="{$item->children('im', true)->image}"></td>
</tr>
EOF;
}
echo '</table>';
?>
The above php works but somehow, I got 8 empty table entities above the result
<tr>
<td></td>
<td><img src=""></td>
</tr>
What's wrong with the code? How do I get rid of the empty table entities?