Home  >  Article  >  php教程  >  php获取淘宝排行榜搜索热门前30名的关键词+案例

php获取淘宝排行榜搜索热门前30名的关键词+案例

PHP中文网
PHP中文网Original
2016-05-25 17:11:501101browse

跳至

<?php
$url="http://top.taobao.com/level3.php?cat=16&show=focus&up=false";
$urltext=strip_tags(file_get_contents($url));
$arr=explode("升降位次",$urltext);
$arr=explode("下一页",$arr[1]);
$arr=explode("\n",$arr[0]);
foreach($arr as $v){$arrnew[]=trim($v);}
$newarr=array_values(array_filter($arrnew));
for($i=1;$i

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn