Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize Online / SQLize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?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) { // Access data for each news item $title = $item['title']; echo trim($title) ; exit(); } } ?>
Copy Clear