Javascript String Length Differs From PHP mb_strlen
- by TheOnly92
I use document.getElementById("text").value.length to get the string length through javascript, and mb_strlen($_POST['text']) to get the string length by PHP and both differs very much. Carriage returns are converted in javascript before getting the string length, but I guess some characters are not being counted.
For example,
[b]15. Umieszczanie obrazka z logo na stronie zespolu[/b]
This block of text is calculated 57 in javascript and 58 in PHP. When the text gets long, the difference increases. Is there any way to overcome this?