19 lines
553 B
PHP
19 lines
553 B
PHP
|
<?php
|
||
|
function getFeeds($url) {
|
||
|
$content = file_get_contents($url);
|
||
|
$items = new SimpleXmlElement($content);
|
||
|
$array = get_object_vars($items);
|
||
|
$array2 = get_object_vars($array['channel']);
|
||
|
$news= $array2['item'];
|
||
|
$c=count($news);
|
||
|
for ($i=0; $i<$c;$i++){
|
||
|
$news2[$i]['massiv']=get_object_vars($news[$i]);
|
||
|
$news2[$i]['img']=get_object_vars($news2[$i]['massiv']['enclosure'])['@attributes']['url'];
|
||
|
}
|
||
|
return $news2;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
$smarty->assign('news', getFeeds('https://minzdrav.midural.ru/rss'));
|
||
|
?>
|