note 67972 deleted from function.sizeof by colder
| From: | colder@php.net | Date: | Tue, 16 Jan 2007 14:19:26 +0000 |
| Subject: | note 67972 deleted from function.sizeof by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-121792@lists.php.net to get a copy of this message | ||
Note Submitter: stoobers at yahoo dot com
----
here is a significant gotcha!
sizeof($a) gives the size of $a when $a is an array.
but call it on a string and it will return 1. it won't treat a string like a char array, as
the c language does. to get the size of a string, use strlen. also, there is no end of string
character counted by strlen.