Re: getting the "next" element of an associative array

From: Date: Thu, 12 Jul 2007 06:26:40 +0000
Subject: Re: getting the "next" element of an associative array
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-258667@lists.php.net to get a copy of this message
let's say we have the following associative array: $array = array( "red" => "ferrari", "yellow" => "volkswagen", "green" => "mercedes", "blue" => "volvo" ); now: how do i get the key of the next array element (in this case "green")? $next = ?
Why not define your array with number index as well in the first place? -- .~. Might. Courage. Vision. Sincerity. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Fedora Core 4) Linux 2.6.17-1.2142_FC4 ^ ^ 14:26:01 up 160 days 22:10 2 users load average: 0.00 0.02 0.00

« previous php.general (#258667) next »