strlen(3) php man page | unix.com

Man Page: strlen

Operating Environment: php

Section: 3

STRLEN(3)								 1								 STRLEN(3)

strlen - Get string length

SYNOPSIS
int strlen (string $string)
DESCRIPTION
Returns the length of the given $string.
PARAMETERS
o $string - The string being measured for length.
RETURN VALUES
The length of the $string on success, and 0 if the $string is empty.
CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Prior versions treated arrays as the string | | | Array, thus returning a string length of 5 and | | | emitting an E_NOTICE level error. | | | | +--------+---------------------------------------------------+
EXAMPLES
Example #1 A strlen(3) example <?php $str = 'abcdef'; echo strlen($str); // 6 $str = ' ab cd '; echo strlen($str); // 7 ?>
NOTES
Note strlen(3) returns the number of bytes rather than the number of characters in a string. Note strlen(3) returns NULL when executed on arrays, and an E_WARNING level error is emitted.
SEE ALSO
count(3), grapheme_strlen(3), iconv_strlen(3), mb_strlen(3). PHP Documentation Group STRLEN(3)
Related Man Pages
strlen(3posix) - posix
strlen(3p) - suse
grapheme_strlen(3) - php
substr_count(3) - php
strlen(3) - minix
Similar Topics in the Unix Linux Community
String Manipulation Question....
How to free the memory?
How come '\0' doesnt show up in the debugger?
length function
How to deal with this error: floating constant exponent has no digits