} } exit(W::response($xml, $data, 'news')); break; case 17: $res = wooyun(); $data = array(array('title' => 'wooyun.org 最新提交漏洞', 'cover' => $web . '/img/wooyun.png')); for ($i = 0; $i < count($data); $i++) { if ($res[$i]) { array_push($data, array('title' => $res[$i]['title'], 'note' => $res[$i]['description'], 'link' => $res[$i]['link'])); } } exit(W::response($xml, $data, 'news')); break; case 18: $res = sec0x50(); $data = array(array('title' => 'Web安全手册,专注Web安全', 'cover' => $web . '/img/0x50sec.png')); for ($i = 0; $i < count($data); $i++) { if ($res[$i]) { array_push($data, array('title' => $res[$i]['title'], 'note' => $res[$i]['description'], 'link' => $res[$i]['link'])); } } exit(W::response($xml, $data, 'news')); break; default: break; } } else { //exit(W::response($xml,simsimi($content))); exit(W::response($xml, xiaodoubi($content))); }
<?php header('Content-type:text/html;charset=utf-8'); function sec0x50() { $data = array(); $url = 'http://www.0x50sec.org/feed/'; $result = file_get_contents($url); $xml = simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA); for ($i = 0; $i < 6; $i++) { array_push($data, array('title' => $xml->channel->item[$i]->title, 'description' => $xml->channel->item[$i]->description, 'link' => $xml->channel->item[$i]->link)); } return $data; } print_r(sec0x50());