I have a pair of arrays similar to this:
I cannot manipulate the functions...
//In one file the functions
function somename1(){
return array(
1=>array('card_id'=>1,'card_date'=>'2010-12-12','photos'=>array(
array('photo_id=>4),'qty'=>2),
array('photo_id=>9),'qty'=>6));
}
function somename2(){
return array(
1=>array('photo_id'=>4,'name'=>'Smiles','price'=>'100'),
2=>array('photo_id'=>7,'name'=>'Ugly','price'=>'150'),
3=>array('photo_id'=>9),'name'=>'Estatic','price'=>'100');
}
//In the main index file we have (cannot change this either)
//Notice Quantity is in the array from function 1 and this is the issue:
<?php
foreach ($photo_details['photos'] as $pid => $info) {
?>
<tr>
<td><?php echo $info['name'];?></td>
<td><?php echo $info['price'];?></td>
<td><?php echo $info['qty'];?></td>
</tr>
<?php
}
?>
//The output to the table becomes something like:
Name | Price | QTY
Undefined: ... Undefined... 2
Undefined:.... Undefined... 6
The solution needs to be in a 3rd file I already have.
My question is how do I merge these so when the index file is run I don't get an undefined error?