PHP strlen Function
The strlen function in PHP is used to return the length of a string. The syntax of the strlen function is:
Let's take a look at the examples below:
print strlen ('Strlen Function');
print strlen (' Length ');
From the above, we see that spaces count towards string length just like a character does.