Sir I have these codes
$string = ' ab';
echo (strlen($string))."<br>"; // returns 4
$count = mb_strlen($string);
echo $count."<br/>"; // returns 4
$length = count(str_split($string));
echo $length."<br/>";// returns 4
All above method return 4
But I need 2 because there are TWO white spaces in the beginning of $string
So there are only two characters in $string.
How to count charcters without white spaces?