$$key = $val";} //-- !!! Прием информации из $_SERVER; if(empty($_COOKIE['title_banner']) || strstr($_SERVER['REQUEST_URI'],'banner2.htm')) { $feed = implode(file('https://optimizm.inc.kz/feed/')); //print "Feed:
$feed"; $xml = simplexml_load_string($feed); $json = json_encode($xml); $array = json_decode($json,TRUE); $rand_news = rand(0,19); //print "\n
".$array['channel']['item'][$rand_news]['link']; //print "\n
".$array['channel']['item'][$rand_news]['title']; setcookie("title_banner",'',time() - 15,'/'); setcookie("title_banner",$array['channel']['item'][$rand_news]['title'],time() + 15,'/'); setcookie("test",'test COKies',time() + 15,'/'); //sleep(2); header ('Location: '.$array['channel']['item'][$rand_news]['link']); } ?> <?php if(!empty($_COOKIE['title_banner'])) print $_COOKIE['title_banner']; else print "Баннер-2018"; ?>