Home >Backend Development >PHP Tutorial > PHP判断是不是包含某个汉字

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

WBOY
WBOYOriginal
2016-06-13 12:56:442465browse

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"?>

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