<?php
header("Content-type: text/html; charset=utf-8");
$name = 'wd='.$_GET['name'];
$html = (string)request_by_curl('http://yongjiuzy.net/index.php?m=vod-search',$name);
$a = '/<td class=\".*\"><a href=\"(.*)\" .*>(.*)<font color=\".*\">/';
preg_match_all($a,$html,$m);
foreach ($m[2] as $value) {
$text[] = $value;
}
foreach ($m[1] as $value) {
$href[] = $value;
}
$all = array('name' =>$text ,'href' =>$href );
$all_json = json_encode($all);
echo $all_json;
function request_by_curl($remote_server, $post_string) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $remote_server);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, "ChinaLBT");
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询