In general, we use the DOM directly in the processing of XML documents if there is Chinese in the Chinese language will be converted to garbled, the following we use the Iconv () function to achieve the encoding conversion, to prevent Chinese
Use the ICONV function to fetch the UTF-8 encoded page into gb2312, found that only with the ICONV function to fetch the data of a transcoding data will be less for no reason
The code is as follows
Copy Code
echo
Problem description in the CentOS system using Apache Server Installation GBK encoding program garbled, this is mainly because the default installation of Apache server character encoding for UTF-8, if the GBK program does not force encoding will
Because the Chinese is two bytes so can not be like English and numbers to use SUBSTR () This will appear garbled, fortunately in PHP has Mb_substr () function to deal with this problem, the need for friends to see.
First, Chinese interception:
In PHP if we do not make any settings in general the use of the date output time is error, and very large.
Question: echo date (' O-m-j h:i ');
The code is as follows
Copy Code
〈?phpecho Date (' y-m-d h:i:s ');?〉
Chinese in the development of PHP often inadvertently encountered problems, today we look at Json_encode Chinese garbled solution, although the method is not very good, but can solve the problem only
The code is as follows
Copy Code
Here is a way to open Wusu hints in PHP, a friend you need to refer to.
One: php.ini configuration
There are two configuration variables associated with this in the php.ini configuration. The following are the two variables and their default values:
According to my experience in PHP and MySQL garbled is generally a document encoding problems such as gbk,uft8,gb2312 and page encoding inconsistency, below I summarized the phpMyAdmin display Chinese garbled solution.
Look first.
Resolution
Ajax page garbled with Get post garbled solution
ASP page before the various garbled, page refresh on garbled or link garbled, last night to ask the next degree Niang, summed up a solution to do, in all ASP page before adding , 65001 refers to the
Parse error:syntax error, unexpected T_lnumber
First of all, you have a problem with the variable assignment, and you will get an error when the Str_replace () is not performed.$a = ' "female teacher to prove to the children, the importance of
What is the difference between empty and is_null?
BOOL Empty (mixed $var)
If Var is a non-null or nonzero value, empty () returns FALSE. In other words, "", 0, "0", NULL, FALSE, Array (), Var $var; and objects that do not have any properties will
The source of the Mail body is sometimes directly in the TextBox text content, but if the text content is not processed, the text will not have any format, squeezed together, line by row display. Now it's about how the text can be wrapped and not
Ecshop Classification tree Show solutions for all classifications if you need a friend, refer to this article.
Here's how to fix it:In goods.php, for example.
The code is as follows
Copy Code
$smarty->assign (' categories
This article introduces everyone in PHP development will often encounter a about require_once usage, there is a need for friends to refer to.
Wwwroot//Website root absolute path is: F:/wwwroot
--folder_a//Folder
Chinese garbled solution in PHP tutorial
The most sleep is the Ajax post get Chinese garbled,
When passing Chinese with Ajax: FF will be smart enough to automatically convert Chinese characters to hexadecimal. BC's IE has to be handled by itself. -_
This article mainly describes the use of the second parameter in PHP json_decode and Var_export, there is a need to understand PHP Json_decode and var_export usage of friends can also refer to the next.
Both Json_decode and Var_export have a second
Some methods have been modified. The expression is read directly from the directory. So now you can easily increase or decrease the image of the expression. Just put the picture in the face directory. However, the Chinese image name is not supported
The article introduced PHP in Editplus,include,chrome, more than a blank line, Utf-8+bom, have encountered the same problem of friends can refer to the solution.
Workaround we just set the code to Utf-8.
http://www.bkjia.com/PHPjc/632196.html
This article introduced a few about the PHP session never expires in the Setup method, do not modify the program is the best way, because if the program is modified, the test department must be very depressed like me, then only modify the system
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