note 15090 added to function.sizeof.php
| From: | vhegde at myersinternet dot com | Date: | Mon, 27 Aug 2001 22:00:53 +0000 |
| Subject: | note 15090 added to function.sizeof.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17220@lists.php.net to get a copy of this message | ||
One thing to remember when using sizeof() would be that the number it returns is 1-based , not
0-based;so if you are going to insert data from an array into a database, and are using a for loop,
be sure to use the for-loop counter from 0 to the value 1 less than the value returned by the sizeof
function, for example :
for ($i = 0;$i < sizeof($array);$i++)
and not :
for ($i = 0;$i = sizeof($array);$i++)
http://www.php.net/manual/en/function.sizeof.php