Heim > Artikel > Backend-Entwicklung > PHP数组转化有关问题
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')
------解决方案--------------------
foreach($arr as $v) $ar[]=substr(join('',$v),0,-1); print_r($ar); <div class="clear"> </div>