Correcting teacher:灭绝师太
Correction status:qualified
Teacher's comments:第二个作业思路新奇, 看好你哦~
$data = ‘name’=>’zhangdan’,’id’=>2,’name’=>’lisi’,’id’=>1;
$data = [['name'=>'zhangdan','id'=>2], ['name'=>'lisi','id'=>1]]; foreach($data as $k=>$v){
$data[$k]["user"]=$k["name"];
} ;
print_r($data);
$func = function($value) {
return $value * 2;
};
echo '<pre>';
print_r(array_map($func, range(1, 50)));