Home  >  Article  >  Backend Development  >  PHP数组转化有关问题

PHP数组转化有关问题

WBOY
WBOYOriginal
2016-06-13 13:25:50797browse

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); <div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn