strlen() function is used to get string length.
Syntax : int strlen(string $string)
Returns the length of the given string on success, and 0 if the string is empty.
Example
<?php $firstString = 'this world is very beautiful'; echo strlen($firstString) . "<br>"; $secondString = 'php is easy'; echo strlen($secondString); ?>
Output :
28 11