I used to use the SETNAMESutf8 statement to set the character set before each connection, but in mysqli There Is A mysqli_set_charset function that does this. I thought it was exactly the same as what I set myself, however, Thisisthepreferred is found in its document note... I used to use
Set names utf8
Statement to set the character set, but in
Mysqli
There is
Mysqli_set_charset
The function does this. I thought it was exactly the same as what I set myself, but in its document note, I found that
This is the preferred way to change the charset. Using mysqli_query () to set it (such as set names utf8) is not recommended.
The two are different. What is the difference?
Reply content:
I used to useSet names utf8
Statement to set the character set, but inMysqli
There isMysqli_set_charset
The function does this. I thought it was exactly the same as what I set myself, but in its document note, I found that
This is the preferred way to change the charset. Using mysqli_query () to set it (such as set names utf8) is not recommended.
The two are different. What is the difference?