php man page for strlen

Query: strlen

OS: php

Section: 3

Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar

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(3p) - centos
strlen(3p) - suse
grapheme_strlen(3) - php
strlen(3) - xfree86
strlen(3) - minix
Similar Topics in the Unix Linux Community
Problems with Strlen
String Manipulation Question....
How to free the memory?
How come '\0' doesnt show up in the debugger?
Need help to find total counts in a string