Code:
$file = simplexml_load_file($url); {
foreach($file->entry as $post) {
$row = simplexml_load_string($post->asXML()); // after adding this line, i get error message
$links = $row->xpath('//link[@rel="alternate" and @type="text/html"]');
echo (string) $post->title;
echo (string) $links[0]['href'];
Leave a comment: