UTF-8 encoded Chinese characters in phpmysql are converted to pinyin
Require_once ('pinyin _ table. php ');
Function get_pinyin_array ($ string)
{
Global $ pinyin_table;
$ Flow =
Php Chinese character unicode encoding and decoding
// Encode the content in unicode format: yoka \ u738b (original: yoka King)
Function unicode_encode ($ name)
{
$ Name = iconv ('utf-8', 'ucs-2'
Php automatically recognizes text encoding and converts
/**
* @ String the text to be converted
* @ Encoding: Target encoding
**/
Function detect_encoding ($ string, $ encoding = 'gbk '){
$
Php interview questions and answers
$ A = date ("y-m-d h: I: s", strtotime ("-1 day "));
Print_r ($ );
2. differences between echo (), print (), and print_r () (3 points)
Echo and print are not a
Php character encoding and conversion
$ String = mb_convert_encoding ($ string, character output encoding, original character encoding );
For example, a webpage uses gbk encoding, and a string uses UTF-8
Phpisset () and unset () functions
$ Var = '';
// The result is true, so the subsequent text is printed.
If (isset ($ var )){
Print "this var is set so I will print .";
}
// In the following
Small example of php destructor
Function _ destruct (){
/* Class initialization code */
}
The Destructor is automatically called by the system and cannot contain parameters.Example:
Php string encoding conversion function can automatically identify the original encoding
/**
* Data encoding and conversion
* @ Param array/string $ data array
* @ Param string $ encoding after output
Php constructor and Destructor
In php programming, an object-oriented function is called a constructor. it is a method automatically called when an object is created to complete class initialization.As long as the php class is loaded,
PHPLinuxhtmlJS mobile game development MySQL and other tutorials online disk sharing
IT tutorial sharing ~! PHP/Linux/html/JS/mobile game development/MySQL/and other tutorials ~!Don't talk nonsense, go to resources:New Linux Video Tutorial:
Phpmysql escape special character functions
This article describes common functions used to program escape special characters in php mysql and how to implement escape characters in php. For more information, see.In php mysql programming,
Php code conversion function (iconvmb_convert_encoding)
Echo iconv ("ISO-8859-1", "UTF-8", "This is a test .");
?>
2. syntax of the mb_convert_encoding function:
/* Convert
Php connection to mysql two methods mysql garbled problem
// In conf/php. ini, use "/php_mysql" in vim to search for extension = php_mysql.dll, remove the previous ";", and add extension = php_mysqli.dll below;
$
Php practical functions for filtering Special characters
// Special character filtering
Function htmldecode ($ str)
{
If (empty ($ str) return;
If ($ str = "") return $ str;
$ Str =
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