This article to share the content is about to solve the PHP Chinese garbled problem, has a certain reference value, the need for friends can refer to
We are writing the following PHP code:
<?php$sum=0; $total =1.2; $sum = $total; echo GetType ($sum); Echo ' </br> '; $sum 1=0; $total 1= $sum; Echo GetType ($ TOTAL1);//Gets the type of the variable $sum3=100;echo ' </br> '; Settype ($sum, "string");//sets the type of the variable echo GetType ($sum 3); Echo ' </br > '; Echo ' determines whether a variable exists: '; $a =5;echo isset ($a);? >
, we will find PHP garbled
The following situation occurs:
Double
Double
Integer
Arrival Yukata 柇 Juan € Juan 彉 stated expiry refer 忔 ionizing å ﹀ workspace 鍦: 1
In other words, it is the Chinese language that determines whether a variable exists: 1 '
How to solve?
The method is simple, add in the code
Header ("Content-type:text/html;charset=utf-8");
The code is as follows:
<?phpheader ("Content-type:text/html;charset=utf-8"), $sum =0, $total =1.2; $sum = $total; echo GetType ($sum); Echo ' </br> '; $sum 1=0; $total 1= $sum; Echo GetType ($total 1);//Gets the type of the variable $sum3=100;echo ' </br> '; Settype ($sum, " String ");//sets the type of the variable echo GetType ($sum 3); Echo ' </br> '; Echo ' determines whether a variable exists: '; $a =5;echo isset ($a); >