Skip to content
Advertisement

How can I use strlen in php for Persian?

I have this code:

JavaScript

Since $string has 3 Persian characters, output must be 3 but I get 6.

علی has 3 characters. Why my output is 6 ?

How can I use strlen() in php for Persian with real output?

Advertisement

Answer

try this:

JavaScript

it will work for any php version.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement