Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
$url="https://rus.postimees.ee/rss";
$data=file_get_contents($url);
$xml = simplexml_load_string($data);
$json = json_encode($xml);
$cb0_1 = json_decode($json, true);
$cb_1 = $cb0_1['channel']['item'];
$cb0_2 = $cb_1[array_key_last($cb_1)]['title'];
print_r($cb0_1['channel']['item']);
foreach($cb_1 as$key => $value){
$category[]=$value['category']['1'];
};
foreach($category as $v){
$category_1 = array_unique($category);
}
print_r($category);