<?php
$action2 = M('accounts')->where(array('id' => 1 ))->getfield('action2');
$user3 = I('post.user3');
$action2_arr = explode(",", $action2);//转换为数组
$action2_arr[1] = $user3;//将第二个0替换为$user3
$action2 = implode(",", $action2_arr);//转化为字符串 以“,”隔开
$data['action2'] = $action2;
M('accounts')->where(array('id' => 1 ))->save($data);
?>
网友评论