".$array['channel']['item'][$rand_news]['link']; //print "\n
".$array['channel']['item'][$rand_news]['title']; setcookie("title_banner",$array['channel']['item'][$rand_news]['title'],time() + 15); //sleep(2); header ('Location: '.$array['channel']['item'][$rand_news]['link']); } /* $redirect = new Base_Redirect(); $redirect->addParam('title', $array['channel']['item'][$rand_news]['title']); $redirect->setRedirectUrl($array['channel']['item'][$rand_news]['link']); return $redirect; */ /* $redirect = new Base_Redirect(); //$redirect->setMessage('Пользователь {user_name} сохранен'); $redirect->addParam('title', $array['channel']['item'][$rand_news]['title']); $redirect->setRedirectUrl($array['channel']['item'][$rand_news]['link']); $redirect->run(); */ //print " \n "; var_dump($array['channel']['item'][$rand_news]['title']); //print " \n "; var_dump($array); /* $feed = new DOMDocument(); $feed->load('https://optimizm.inc.kz/feed/'); $json = array(); $json['title'] = $feed->getElementsByTagName('channel')->item(0)->getElementsByTagName('title')->item(0)->firstChild->nodeValue; $json['description'] = $feed->getElementsByTagName('channel')->item(0)->getElementsByTagName('description')->item(0)->firstChild->nodeValue; $json['link'] = $feed->getElementsByTagName('channel')->item(0)->getElementsByTagName('link')->item(0)->firstChild->nodeValue; $items = $feed->getElementsByTagName('channel')->item(0)->getElementsByTagName('item'); $json['item'] = array(); $i = 0; foreach($items as $key => $item) { $title = $item->getElementsByTagName('title')->item(0)->firstChild->nodeValue; $description = $item->getElementsByTagName('description')->item(0)->firstChild->nodeValue; $pubDate = $item->getElementsByTagName('pubDate')->item(0)->firstChild->nodeValue; $guid = $item->getElementsByTagName('guid')->item(0)->firstChild->nodeValue; $json['item'][$key]['title'] = $title; $json['item'][$key]['description'] = $description; $json['item'][$key]['pubdate'] = $pubDate; $json['item'][$key]['guid'] = $guid; } //echo json_encode($json); echo $json['link']; */ ?> <?php if(!empty($_COOKIE['title_banner'])) print $_COOKIE['title_banner']; else print "Баннер-2018"; ?>