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

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

WBOY
Release: 2016-06-13 12:56:44
Original
2455 people have browsed it

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template