Home >Backend Development >PHP Tutorial >PHP implementation code to reassign a certain column element
This article mainly shares with you the PHP implementation code for reassigning a certain column of elements. I hope it can help you.
foreach($list as $k=>$val){ if ( $val == "" ) { continue; } foreach ($range as $key => $value) { //将时间替换成 年-月-日的形式 if( $val['bodycode'] == $value['bodycode']){ $list[$k]['edittime'] = date("Y-m-d ", $value['time']); } } }
Related recommendations:
PHP implementation of deleting multiple array object attributes and reassigning them
The above is the detailed content of PHP implementation code to reassign a certain column element. For more information, please follow other related articles on the PHP Chinese website!