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 key of the next array element (in this case "green")?
$next = ?
Funnily enough:
$next = next($array);
http://www.php.net/manual/en/function.next.php
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php