Php bing图像的url参数?
我正在尝试用php解析bing的url图像。 我有这个结果Php bing图像的url参数?,php,codeigniter,url,bing,Php,Codeigniter,Url,Bing,我正在尝试用php解析bing的url图像。 我有这个结果 { "3": { "big": "https:\/\/i.ytimg.com\/vi\/lk634G2E4VY\/maxresdefault.jpg", "thumb": "https:\/\/tse1.mm.bing.net\/th\/id\/OIP.8YesMNHK
{
"3": {
"big": "https:\/\/i.ytimg.com\/vi\/lk634G2E4VY\/maxresdefault.jpg",
"thumb": "https:\/\/tse1.mm.bing.net\/th\/id\/OIP.8YesMNHKw0ytre_fF1ffTgHaEK?w=230&h=170&rs=1&pcl=dddddd&o=5&pid=1.1"
},
...
"20": {
"big": "http:\/\/www.sbs.com.au\/news\/sites\/sbs.com.au.news\/files\/mumbai_slum_fire_131122_getty_0.JPG",
"thumb": "https:\/\/tse1.mm.bing.net\/th\/id\/OIP.y3cTxPY2MMYQfM7v30hexQHaEg?w=230&h=170&rs=1&pcl=dddddd&o=5&pid=1.1"
}
}
我使用php中的函数和简单的html**
我有15个结果。
但我想要另一个结果。
你有解决办法吗?url中的参数?。。。经过多次搜索,我找到了你的想法,谢谢你
Bing有一个参数页面听起来你想处理分页。但是如果bing是通过ajax加载额外的图像,那就不行了。。。。你检查过bing的url吗?是的,我有不同的搜索结果,搜索词相同。正常吗?我有回复。
function bingimages($search)
{
require_once('framick/parser/simple_html_dom.php');
$html = file_get_html('https://www.bing.com/images/search?q=' . $search);
$ret = $html->find('a');
foreach ($html->find('a') as $value) {
$parent = $value->parent();
if (isset($value->find('img')[0])) {
$res[] = array('big' => $value->href, 'thumb' => $value->find('img')[0]->src);
}
}
$res = array_reverse($res);
unset($res[0]);
$res = array_reverse($res);
unset($res[0]); //for remove img of bing
unset($res[1]);
unset($res[2]);
return json_encode($res);
}