PHP determines if it contains a certain Chinese character
Source: Internet
Author: User
PHP determines whether it contains a Chinese character $ url = 'http: // www.youdao.com/smartresult-xml/search.s? Type = ip & amp; q = '; $ xml = file_get_contents ($ url. $ ip); $ data PHP determines whether a Chinese character is contained
$ 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; // Obtain the country
If ($ country = mb_strpos ($ Word_DB, "Japan", 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 saves the country name. Why can't it always be determined?
------ Solution --------------------
Http://www.youdao.com/smartresult-xml/search.s? Type = ip & q =
Only this
? Xml version = "1.0" encoding = "gbk"?>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.