<?php
// The URL of the RSS feed
$url = 'https://www.aripaev.ee/rss';
// Use file_get_contents() to fetch the feed
$rss = file_get_contents($url);
// Use simplexml_load_string() to parse the XML content
$xml = simplexml_load_string($rss);
// Check if the parsing was successful
if ($xml === false) {
echo "Error parsing the XML\n";
foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}
} else {
$data=json_decode(json_encode($xml),true);
foreach ($data as $item) {
var_dump($item);
$title = $item['title'];
echo trim($title) ;
exit();
}
}
?>