Re: arrays
| From: | Khalid El-Kary | Date: | Tue, 05 Nov 2002 18:49:31 +0000 |
| Subject: | Re: arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122835@lists.php.net to get a copy of this message | ||
hi,
the function array is for making a new array. Observe this code and you will get the point
(assuming that you won't to loop for five times)
$myarr= array()
for ($i=0;$i<=5;$i++)
{
$myarr[$i]=$i;
}
//you can then get the values of the array
echo $myarr[0];
echo $myarr[1]; //and like that
note that this loop simply assigns a number to every array index, this is not so useful, but you would probably do something with $i to store a particular value.
khalid
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963