I am currently using the following code:
<?php
$url = 'http://ift.tt/1tO4Qxj';
$xml = new SimpleXMLElement(file_get_contents($url));
foreach ($xml->item as $item) {
$title = $item->title;
$description = $item->description;
}
?>
Which returns the error:
Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in /homepages/34/d540957720/htdocs/newknowledge/cards/index.php:5 Stack trace: #0 /homepages/34/d540957720/htdocs/newknowledge/cards/index.php(5): SimpleXMLElement->__construct('<?xml version="...') #1 {main} thrown in /homepages/34/d540957720/htdocs/newknowledge/cards/index.php on line 5
If anybody has an idea how to fix this I would love to know. Thanks.
No comments:
Post a Comment