> -----Original Message----- > From: Sean Malloy [mailto:[EMAIL PROTECTED]] > Sent: 02 January 2003 13:35 > To: Timothy Hitchens (HiTCHO); [EMAIL PROTECTED] > Subject: RE: [PHP] makeing an array > > > see example 2.
But that produces the elements in reverse order -- no use if you want them in their proper order! In whioch case, Hitcho's solution is the right and proper one (and I like the elegance of the two parallel assignments in the loop initializer clause!). > > > > -----Original Message----- > > > > From: Timothy Hitchens (HiTCHO) [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, 1 January 2003 4:41 PM > > > > To: Philip J. Newman; [EMAIL PROTECTED] > > > > Subject: Re: [PHP] makeing an array > > > > > > > > > > > > Use the count like following inside to ensure that you don't > > > > call on a non existent index. > > > > > > > > for ($i = 0, $x = count($comment); $i < $x; $i++) > > > > { > > > > echo $comment[$i].'<br />'; > > > > } Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php