Re: Array Search Not Working?

From: Date: Wed, 10 Mar 2010 17:08:34 +0000
Subject: Re: Array Search Not Working?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-302671@lists.php.net to get a copy of this message
Alice Wei wrote: > From: ajwei@alumni.iu.edu > To: nospam@mckenzies.net > CC: php-general@lists.php.net > Subject: RE: Array Search Not Working? > Date: Wed, 10 Mar 2010 11:21:26 -0500 I'm still a little foggy on what you're doing, but doing, but does this help? $from = explode("-", $from); $state_colors = explode("-", $state_colors); $change = explode("-", $change); $old = array_combine($from, $state_colors); $new = array_combine($from, $change); //show all values foreach($old as $key => $val) { echo "{$key} old={$old[$key]} new={$new[$key]}<br />\n"; } //lookup a particular value $test = "Muskogee, OK"; echo "TEST={$test} old={$old[$test]} new={$new[$test]}<br />\n"; /* I'm proud to be an Okie from Muskogee, A place where even squares can have a ball We still wave Old Glory down at the courthouse, And white lightnin's still the biggest thrill of all */ -- Thanks! -Shawn http://www.spidean.com

« previous php.general (#302671) next »