[PHP] Creating an assoc array from two arrays

2004-04-23 Thread Alex Hogan
Hi All,

I am looking through the manual and I think I may be blind or something, but
how can I create an associative array from two arrays.
What I have is two arrays that look like this;

Array1([0]=Spider, [1]=Monkey, [2]=Cards)
Array2([0]=26.3, [1]=0.65, [2]=62.07)

I want to combine them into;

ArrayCombined([Spider]=26.3, [Monkey]=0.65, [Cards]=62.07)

So I can compare it to a third array.

TIA

alex




** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] Creating an assoc array from two arrays

2004-04-23 Thread John W. Holmes
From: Alex Hogan [EMAIL PROTECTED]
 I am looking through the manual and I think I may be blind or something,
but
 how can I create an associative array from two arrays.
 What I have is two arrays that look like this;

 Array1([0]=Spider, [1]=Monkey, [2]=Cards)
 Array2([0]=26.3, [1]=0.65, [2]=62.07)

 I want to combine them into;

 ArrayCombined([Spider]=26.3, [Monkey]=0.65, [Cards]=62.07)

 So I can compare it to a third array.

foreach($array1 as $key = $value)
{ $arraycombined[$value] = $array2[$key]; }

---John Holmes...

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