strlen()
19th January 2021
0 Comments
Programming Language
PHP [Versions: 4, 5, 7, 8]
Syntax
Typical Usage
Gets the length of a string in PHP.
Accepted Parameters
- 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()
Example 1
<?php
echo strlen('Codeblock');
The above will output 9, the length of the word ‘Codeblock’.
Similar Functions in Other Languages
- Javascript: str.length
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.