Home > Article > Backend Development > How to solve inconsistent string lengths in PHP
This article mainly shares with you an article to solve the problem of inconsistent PHP string length. It has a good reference value and I hope it will be helpful to everyone. Let’s follow the editor to take a look, I hope it can help everyone.
As shown below:
$paramStr = iconv("UTF-8", "GB2312//Ignore", $paramStr); $paramStr = iconv("GB2312", "UTF-8//Ignore", $paramStr);
These two sentences can solve it.
Related recommendations:
js Example of extracting the length of a certain () special string_javascript skills
php string A more efficient way to determine length
php How to calculate the length of a string
The above is the detailed content of How to solve inconsistent string lengths in PHP. For more information, please follow other related articles on the PHP Chinese website!