Re: Array Search Not Working?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alice Wei wrote:
> From: ajwei@xxxxxxxxxxxxx
> To: nospam@xxxxxxxxxxxxx
> CC: php-general@xxxxxxxxxxxxx
> 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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux