在整个数组上移动之前,我需要将一些函数应用于数组中的某个关键项,但我可能会错过某些东西。
这里是我的代码:在处理它们之前更新POST数据的PHP数组
// Get generated datas
$data_post = $this->input->post('form_data'); // Need to update this array
foreach($data_post as $data){
$data['password'] = password_encrypt($data['password']);
var_dump($data); // Password encryption succeed
}
var_dump($data_post); // But here, the password is still the same, no encryption applied
所以在代码段评论,我应该如何更新主$data_post
阵列与foreach()
所做的修改?
完美!谢谢弗拉德。 – aspirinemaga