★ wanayoo — archive 1999 http://www.php.net/manual/function.strlen.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Strings
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Strings
* AddCSlashes
* AddSlashes
* bin2hex
* Chop
* Chr
* chunk_split
* convert_cyr_string
* count_chars
* crc32
* crypt
* echo
* explode
* flush
* get_html_translation_table
* get_meta_tags
* hebrev
* hebrevc
* htmlentities
* htmlspecialchars
* implode
* join
* levenshtein
* ltrim
* md5
* Metaphone
* nl2br
* ob_start
* ob_get_contents
* ob_end_flush
* ob_end_clean
* ob_implicit_flush
* Ord
* parse_str
* print
* printf
* quoted_printable_decode
* quotemeta
* rtrim
* sscanf
* setlocale
* similar_text
* soundex
* sprintf
* strcasecmp
* strchr
* strcmp
* strcspn
* strip_tags
* stripcslashes
* stripslashes
* stristr
* strlen
* str_pad
* strpos
* strrchr
* str_repeat
* strrev
* strrpos
* strspn
* strstr
* strtok
* strtolower
* strtoupper
* str_replace
* strtr
* substr
* substr_count
* substr_replace
* trim
* ucfirst
* ucwords
Manual: strlen
View the source code for this pageSearch the site



Previous page
 stristr
 Updated
Sat, 12 Aug 2000
str_pad 
Next page


strlen

(PHP3 , PHP4 )

strlen -- Get string length

Description

int strlen (string str)

Returns the length of string.


User Contributed Notes: strlen


rattlesnake@UniNova.zzn.com
22-Nov-1999 07:29
Never one to pass a function what it expects, I figured the following might be useful to know: strlen() returns 0 (zero) for a blank string or an undefined variable. If no parameter is given, it generates a Warning.


ryan@audiogalaxy.com
24-Mar-2000 12:42
FYI, strings don't appear to be \0 terminated. You can pack binary data into a string, join it with other binary packed strings, get the correct strlen, etc.


php.net@pinguin.conetix.de
01-May-2000 09:14
Bug or feature? I want to treat a string as an array ("traverse it") like this, and it gets me a warning about "illegal string index" when it reaches the end of the string. Shouldn't the "while" fail there anyway?

<pre>
$tmp=0; $s="blah";
while($c=$s[$tmp++]) { echo $c; }
</pre>

This also spits warnings with "do {..} while(..)".

Bug or feature?



simon@simonzone.com
18-May-2000 02:08
Numbers don't have length as such. But if you are after the length of the decimal expression of a number try this: strlen((string)37337)



webmaster@hedgehogwheels.com
27-Jul-2000 10:57
"how can i get the length of a number?"

strlen(strval($yournumber))



0348373e@teleline.es
02-Aug-2000 06:28
estoy empezando ha hacer un grupo de funciones de string (para fechas y demas) explicadas en castellano. El que quiera puede participar.


 About Notes


Previous page
 stristr
 Updated
Sat, 12 Aug 2000
str_pad 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.