Forum Moderators: coopster

Message Too Old, No Replies

Enriching arrays

         

technossomy

8:46 am on Oct 6, 2005 (gmt 0)

10+ Year Member



I have two arrays as such:

$pe = Array(
"AAB" => Array([pe] => 3.45)
"BCD" => Array([pe] => 10.02)
)

$rs = Array(
"AAB" => Array([rs] => 2.34)
"BCD" => Array([rs] => 5.5)
)

and I want to join these arrays, such that the following results:

$arr = Array(
"AAB" => Array([pe] => 3.45, [rs] => 2.34)
"BCD" => Array([pe] => 10.02, [rs] => 5.5)
)

How can one do this?

Thanks in advance

Tech

mincklerstraat

10:47 am on Oct 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



check out the php function array_merge_recursive() at [php.net...]

technossomy

9:40 pm on Oct 6, 2005 (gmt 0)

10+ Year Member



Thanks, that helped.