PHP数组转化有关问题
时间:2021-07-01 10:21:17
帮助过:5人阅读
PHP数组转化问题
Array
(
[0] => Array
(
[0] => user-
[1] => notice-
)
[1] => Array
(
[0] => user-
[1] => calendar-
[2] => calendar-
)
[2] => Array
(
[0] => notice-
[1] => calendar-
)
)
想要的效果
Array([0]=>'user-notice',[1]=>'user-calendar-calendar',[2]=>'user-calendar')
------解决方案--------------------
PHP code
foreach($arr as $v) $ar[]=substr(join('',$v),0,-1);
print_r($ar);