如何把一维数组相结合
程序员文章站
2024-04-04 08:19:23
...
怎么把一维数组相结合
array("你好","这里","太好了","设置","帮助","他人","答案")
把元素三个组成一个
array("你好这里太好了","设置帮助他人","答案")
------解决方案--------------------
array("你好","这里","太好了","设置","帮助","他人","答案")
把元素三个组成一个
array("你好这里太好了","设置帮助他人","答案")
------解决方案--------------------
$ar = array("你好","这里","太好了","设置","帮助","他人","答案");
foreach(array_chunk($ar, 3) as $v) $r[] = join('', $v);
print_r($r);
Array
(
[0] => 你好这里太好了
[1] => 设置帮助他人
[2] => 答案
)
相关文章
相关视频
上一篇: C#中的索引器的简单理解和用法
下一篇: ajax同步模式的浏览器兼容有关问题