function HaberFeed() { header('Content-Type: application/json'); $url = "https://sariyergazetesi.com/haberleri/manset/feed/"; $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $data = curl_exec($ch); curl_close($ch); $feed = new SimpleXMLElement($data); echo '['; foreach($feed->channel->item as $haber){ $haber = '{"haber_guid":"'.$haber->guid.'","haber_title":"'.$haber->title.'"},'; echo $haber; } echo ']'; }