RE: [PHP] Count columns in array
| From: | James Atkinson | Date: | Thu, 15 Feb 2001 18:32:20 +0000 |
| Subject: | RE: [PHP] Count columns in array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39959@lists.php.net to get a copy of this message | ||
> Hello,
>
> I have the array $array[x][y];
>
> if I want to know the x I use count($array);
>
> Now, How can I count the y??
for($x = 0; $x <= count($array); $x++) {
echo "Number of elements at $x: " . count($array[$x]) . "<br>";
}
Thats assumeing that y is an array...
- James