Fri. Feb 26th, 2021

Easy steps to parse RSS/Atom feeds into Array with PHP

Very simple script to parse RSS/Atom feeds into php array 🙂

<?
$feed = implode(file('http://www.antaranews.com/rss/nasional'));
$xml = simplexml_load_string($feed);
$json = json_encode($xml);
$array = json_decode($json);
print_r($array);
?>

Source : http://stackoverflow.com/a/19751841