Hmm, yes I see. Thank you.

I guess what I should look at then is getting the key value (internal
counter/pointer) in the array going to the foreach. Like this example...

$a = array( 1,2,3,17 );

$i =0;/* for illustrative purposes only */

foreach ( $a as $v ) {
    echo "\$ a[$i ]=> $v. \n ";
   $i ++; 
}

Once I have that key value (internal counter) I should be able to do
something with it? What I really want to do (since I can't easily get at the
query building the array being passed to the foreach) is get the foreach to
stop outputting results at a certain limit.

Thanks again,
Verdon


On 5/9/04 11:34 AM, "Matt Schroebel" <[EMAIL PROTECTED]> wrote:

> It's good to understand what foreach is doing:
> <?php
> $car['GM'] = 'Impala';
> $car['TOYOTA'] = 'Corolla';
> $car['HONDA'] = 'Civic';
> 
> foreach ($car as $manufacturer => $ model) {
> echo "$manufacturer - $model <br />\n";
> }
> ?>
> 
> Results:
> GM - Impala
> TOYOTA - Corolla
> HONDA - Civic
> 
> 
> 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to