note 3662 deleted from function.count by philip
| From: | philip@php.net | Date: | Fri, 13 Dec 2002 00:22:20 +0000 |
| Subject: | note 3662 deleted from function.count by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40830@lists.php.net to get a copy of this message | ||
This has bitten me in the softer parts:
$myarray = mysql_fetch_row(...)
$myarray is now an array of strings, some of which may be null. The surprise is that
count($myarray) returns the number of non-null strings in $myarray, rather then the highest index +
1. So forget about iterating over the whole array with "for ($i=0; $i<count($myarray);
i++)"
php 3.0.14