RE: [PHP] Numbered Arrays
| From: | Hunter, Ray | Date: | Mon, 25 Feb 2002 22:14:24 +0000 |
| Subject: | RE: [PHP] Numbered Arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86167@lists.php.net to get a copy of this message | ||
That is probably faster than going through the for loop...
Helps if I read the documentation on Arrays.
Thanks for info Lars,
Ray Hunter
Firmware Engineer
ENTERASYS NETWORKS
-----Original Message-----
From: Lars Torben Wilson [mailto:torben@php.net]
Sent: Monday, February 25, 2002 3:05 PM
To: Phillip S. Baker
Cc: PHP Email List
Subject: Re: [PHP] Numbered Arrays
On Mon, 2002-02-25 at 13:56, Phillip S. Baker wrote:
> What is the quick way to generate numbered arrays?
> I cannot seem to find it in my documentation.
>
> Looking to generate and populate an array with the numbers 0-23.
>
> Thanks
>
> Phillip
http://www.php.net/range
<?php
error_reporting(E_ALL);
$array = range(0, 23);
print_r($array);
?>
Cheers,
Torben
--
Torben Wilson <torben@php.net>
http://www.thebuttlesschaps.com
http://www.hybrid17.com
http://www.inflatableeye.com
+1.604.709.0506
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php