Re: [PHP] getting the "next" element of an associative array

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 1:34 am, Chris wrote: > Olav Mørkrid wrote: >> let's say we have the following associative array: >> >> $array = array( >> "red" => "ferrari", >> "yellow" => "volkswagen", >> "green" => "mercedes", >> "blue" => "volvo" >> ); >> >> then we have a current index into the arra

Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid
yep, a for loop is the fallback i use now. any reason why there isn't a built-in function for this? any plans for it in future versions of php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Chris
Olav Mørkrid wrote: chris for your suggestion to work, the internal array pointer of $array would first have to be set to point to the current element ($index). but how do you do this? this may seem like childs play, but i actually can't find any documented php function for this. it would be s

Re: [PHP] getting the "next" element of an associative array

2007-07-12 Thread Olav Mørkrid
chris for your suggestion to work, the internal array pointer of $array would first have to be set to point to the current element ($index). but how do you do this? this may seem like childs play, but i actually can't find any documented php function for this. it would be something like: array

Re: [PHP] getting the "next" element of an associative array

2007-07-11 Thread Jim Lucas
Olav Mørkrid wrote: let's say we have the following associative array: $array = array( "red" => "ferrari", "yellow" => "volkswagen", "green" => "mercedes", "blue" => "volvo" ); then we have a current index into the array: $index = "yellow"; $current = $array[$index]; now: how do i get the

Re: [PHP] getting the "next" element of an associative array

2007-07-11 Thread Chris
Olav Mørkrid wrote: let's say we have the following associative array: $array = array( "red" => "ferrari", "yellow" => "volkswagen", "green" => "mercedes", "blue" => "volvo" ); then we have a current index into the array: $index = "yellow"; $current = $array[$index]; now: how do i get the