php 搜狗评级查询程序
<?php
$sourcecode = getsourcecode("http://www.sogou.com/web?query=" . $q);
//echo ":".$sourcecode;
if ($sourcecode) {
$sourcecode = iconv('gb2312', 'utf-8', $sourcecode);
preg_match('/搜狗评级:(.*?) /', $sourcecode, $cmatche);
if ($cmatche[1]) {
echo '<script type="text/http://www.phprm.com">parent.document.getElementById("sogourank").innerHTML = "' . $cmatche[1] . '";</script>' . " ";
} else {
echo '<script type="text/javascript">parent.document.getElementById("sogourank").innerHTML = "0/100";</script>' . " ";
}
}本文地址:http://www.phprm.com/code/e81fbc69169c59fda891436c31b681b7.html
转载随意,但请附上文章地址:-)