I am working on array for a project and i want to know how i can add a key value pair at the end of an array. So here are the elements:
[php]1st array
$items = array(
array(‘id’ => ‘1’, ‘desc’=>‘Canadian-Australian Dictionary’, ‘price’=>24.95),
array(‘id’ => ‘2’, ‘desc’=>‘As-new parachute (never opened)’, ‘price’=> 1000),
array(‘id’=>‘3’, ‘desc’=>‘Songs of the Goldfish (2CD set)’, ‘price’=> 19.99)
);[/php]
[php]2nd array:
$cart = array(
array(‘id’ => ‘1’,‘quantity’=>2)
);[/php]
So Basically what to know is how i can add values from 1st array to 2nd array based on the id to have a array like this one.
final array i want to get:
[php]$itemDetail = array(
array(‘id’ => ‘1’, ‘desc’=>‘Canadian-Australian Dictionary’, ‘price’=>24.95, ‘quantity’=> 1)
);[/php]
Hope i expose my concern properly. Thanks