Re: Arrays and each()

From: Date: Thu, 10 Apr 2003 11:22:33 +0000
Subject: Re: Arrays and each()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143312@lists.php.net to get a copy of this message
Greets, Found the problem.........situation resolved. On Thu, 2003-04-10 at 13:17, Chris Blake wrote: > Greetings learned PHP(eople), > > On the advice of many on this list, I recently purchased > "PHP & MYSQL Web Development" by Luke Welling, and am now going through > each chapter learning about PHP. > > One example from said tome (Chapter 3 pg 75) is as follows : > > <?php > $prices = array('Guitars'=>1000, 'Drums'=>2000, > 'Keyboards'=>3000); > > //Use "each()" to output array > while ( $element = each( $prices) ) > { > echo $element[ 'key' ] ; > echo ' - '; > echo $element['value']; > echo '<br />'; > } > ?> > > The output is blank ! > I`ve fiddled around with the brackets, quotes et al but still nadda..... > > Any ideas ? > > Thanks > > -- > Chris Blake > Office : (011) 782-0840 > Cell : 083 985 0379 > What would I know about love at first sight,I`ve never seen a Diablo > filled with R 200-00 notes before ! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 Linux vs. Windows is a no WIN situation.

« previous php.general (#143312) next »