How to solve inconsistent string lengths in PHP

小云云
Release: 2023-03-19 06:40:01
Original
1805 people have browsed it

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);
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template