I must be missing something obvious: I'm returning an associative array after my query runs, and for each nested array I wish to append $child['Is_Child'] = '0';
When I print out the $child
array it is correct, but the $child_participants
array does not have it appended; why?
if ($query->num_rows() > 0)
{
$child_participants= $query->result_array();
foreach($child_participants as $child)
{
$child['Is_Child'] = '0';
}
return $child_participants;
}
Pass a reference instead of value by using &$child
foreach($child_participants as &$child)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments