$dayOfWeek = array('Mon', 'Sun');
$dateWithHours = array( array('date'=>'12-20-2010', 'hours'=>4.0), array('date'=>'12-19-2010', 'hours'=>2.0) );
foreach(&$dateWithHours as $k=$v)
{
$v['day'] = $dayOfWeek[$k];
}
Remember the ampersand. Without it, $ v is a copy that will not change the original. With it, you can change the link.
source
share