PHP头条
热点:

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


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

www.phpzy.comtrue/phprm/15094.htmlTechArticlePHP判断是不是包含某个汉字 PHP判断是否包含某个汉字 $url='http://www.youdao.com/smartresult-xml/search.s?type=ip $xml=file_get_contents($url.$ip); $data=simplexml_load_string($xml); $country=$data->product->location;//获取...

相关文章

相关频道:

PHP之友评论

今天推荐