PHPize Online / SQLize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
Copy Clear
Copy Format Clear
<?php $url = 'https://rus.postimees.ee/rss'; // Загружаем RSS-ленту $xmlstring = file_get_contents($url); $xml = simplexml_load_string($xmlstring); $json = json_encode($xml); $array = json_decode($json, TRUE); $row = 1; foreach ($array['channel']['item'] as $item) { $hasEstoniaCategory = isset($item['category']) && in_array('Estonia', (array) $item['category']); if ($hasEstoniaCategory) { echo $row . ". " . $item['title'] . "\n"; $row++; } } ?>
Show:  
Copy Clear