读书人

PHP判断是不是包含某个汉字

发布时间: 2013-01-19 11:41:36 作者: rapoo

PHP判断是否包含某个汉字
$url='http://www.youdao.com/smartresult-xml/search.s?type=ip&q=';
$xml=file_get_contents($url.$ip);
$data=simplexml_load_string($xml);
$country=$data->product->location; //获取国家
if($country==mb_strpos($Word_DB, "日本", 0, 'gbk'))
{
Header("Location:http://www.hao123.com");
}
else
{
echo "sorry,but the country that you live in have not permission to view this page.";
}
?>

$country保存了国家名,为什么总是判断不出来呢?
[解决办法]
http://www.youdao.com/smartresult-xml/search.s?type=ip&q=
只看到这个
?xml version="1.0" encoding="gbk"?>
<smartresult/>

读书人网 >PHP

热点推荐