Php intercepts UTF-8 or gbk encoded Chinese and English strings
// String truncation
$ A = "s @ ";
Var_dump (strlen_weibo ($ a, 'utf-8 '));
The result output is 8, where the letter s is counted
Php practical functions for filtering Special characters
// Special character filtering
Function htmldecode ($ str)
{
If (empty ($ str) return;
If ($ str = "") return $ str;
$ Str =
Endless learning, benefiting for life
Finally, I completed my first PHP and html project in my life. I instantly ignited my ambition and told myself: you can do it, but you are just a little lazy!For the first time, with such a strong sense
PHP character string special symbol filtering method
Filter methods for special characters of PHP strings:
Sometimes we may encounter the problem of filtering special characters in strings. This article provides a method to process Special strings,
Php separates arrays by a specified number
/**
* Separate arrays by the specified number.
* @ Param array $ array the array to be split
* @ Param int $ number of groupNum groups
*/
The maximum execution time of the php page, set_time_limit, does not work.
Set_time_limit does not take effect or the solution is invalid.
Exec ("set names 'utf8'"); // Default Code $ db-> setAttribute (PDO_ATTR_ERRMODE, PDO_ERRMODE_EXCEPTION);
PHP image upload and rename methods
/*
Com_create_guid () is a function supported by php5. for unsupported versions, you can define them by yourself.
*/
Function guid (){
If (function_exists ('com _
Insert operations for the PHPPDO database class
// Insert data
// Prepare SQL statements
$ SQL = "INSERT INTO 'test' ('name') VALUES (: name )";
// Call the prepare method prepare to
A phppdomysql operation class
/**
* PDO operations
* Created by PhpStorm.
* User: sumiaowen
* Date: 13-11-28
* Time: PM
* To change this template use File | Settings | File
Phpgd library-based image creation method
$ Im = imagecreate (200,150 );
Echo $ im;
?>
// Output
Resource id #1
2. magecreatetruecolor-create a true-color canvas 1 in the format of
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