$str = "' 324 is";
if (!eregi ("[^\x80-\xff]", "$str")) {
echo "All is Chinese";
}else{
echo "not";
}
Copy CodeSecond, the judgment contains the Chinese
$str = "Chinese";
if
How to filter PHP string special symbols:
Sometimes we encounter the problem of filtering special characters in strings, this article provides a way to deal with special strings, there may be omissions, if the reader found a message can tell me,
To share the usage of PHP ini_set and Ini_get functions, a friend who learns PHP programming can follow.PHP's Ini_set function is PHP's own function to modify the settings php.ini configuration file, it is convenient to use this function, do not
Introduced under the Nginx and PHP environment to modify the PHP upload file size limit method, to solve the PHP upload file can not be greater than 2M limit, there is a need for friends reference.PHP upload files, first modify the php.ini settings,
Replacement encryption replacement from the previous version
function Compress_func ($match) {return strlen ($match [0]). $match [0]{0};}
function Uncompress_func ($match) {return str_repeat ($match [2], $match [1]);}
function
When using PHP to import CSV files to the MySQL database, there is a case of Chinese garbled, here to share the next solution, the need to refer to the friend.Many of the methods are to read and upload the contents of the CSV file into the MySQL
$pagesize = 10; Set the number of records to display per page
$conn =mysql_connect ("localhost", "root", ""); Connecting to a database
$rs =mysql_query ("SELECT count (*) from tb_product", $conn); Total Records obtained $RS
Class Foo
{
Private $name = ' hdj ';
Public Function GetName () {
return $this->name;
}
}
Class Bar extends Foo
{
Public $name = ' Deeka ';
}
$bar = new Bar;
/*
Com_create_guid () is a feature supported by the PHP5 version and can be defined on its own for unsupported versions
*/
function guid () {
if (function_exists (' Com_create_guid ')) {
return Com_create_guid ();
Proxy IP Direct exit
Empty ($_server[' Http_via ')) or exit (' Access Denied ');
Prevent Quick refreshes
Session_Start ();
$seconds = ' 3 '; time period [s]
$refresh = ' 5 '; Number of refreshes
Setting up
Initialize a Curl Object
$curl = Curl_init ();
Set the URL you need to crawl
curl_setopt ($curl, Curlopt_url, ' http://bbs.it-home.org ');
Set Header
curl_setopt ($curl, Curlopt_header, 1);
Sets the curl
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service