发布网友 发布时间:2022-04-06 03:37
共1个回答
热心网友 时间:2022-04-06 05:06
用 join 函数做:
<?php
$v = [];
$v['Rmsg'] = '1,0,0,0,0';
$v1 = explode(",", $v['Rmsg']);
print_r($v1);
$v1[3] = 1;
$v['Rmsg'] = join(',', $v1);
print_r($v);
还有我必须要吐个槽,既然都用键值对了,干嘛要把数组存成字符串啊,直接把数组存进去不好嘛