19th January 2021
PHP [Versions: 4, 5, 7, 8]
Gets the length of a string in PHP.
- string (string) (Required): The string you’d like to get the length of.
Return Value(s)Returns the length of the string.
Examples of strlen()
<?php echo strlen('Codeblock');
The above will output 9, the length of the word ‘Codeblock’.
Similar Functions in Other Languages
Was This Helpful?
If this post has helped you, please let me know. Your feedback will be highly appreciated and will help me build better content.