亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - php 路徑分類實(shí)現(xiàn) 文件夾顯示
滿天的星座
滿天的星座 2017-05-16 13:04:57
[PHP討論組]

我通過(guò)svn獲取到需要更新的文件路徑之后,php怎樣把路徑分類生成需要的格式,嘗試多很多方式都不知道該如何處理:
獲取到的路徑:
$arr = [

        'Public/images/list/order.png',
        'Public/images/list/reverse.png',
        'Application/Crm/View/UserManagement/add_maternal.html',
        'Application/Crm/View/UserManagement/add_member.html',
        'Application/Crm/View/UserManagement/detail_member.html',
        'Application/Crm/Model/ShixinMaternalFamilyModel.class.php',
        'Application/Crm/Controller/ReturnWorkController.class.php',
        'Application/Crm/Controller/UserManagementController.class.php',
        'Application/SystemSetting/View/CustomForm/edit_content.html',
   ];

我想要的格式:

1 =>
array (

'text' => 'Public',
'nodes' => 
array (
  0 => 
  array (
    'text' => 'images',
    'nodes' => 
    array (
      0 => 
      array (
        'text' => 'list',
        'nodes' => 
        array (
          0 => 
          array (
            'text' => 'reverse.png',
          ),
          1 => 
          array (
            'text' => 'order.png',
          ),
        ),
      ),
    ),
  ),
),

),
2 =>
array (

'text' => 'Application',
'nodes' => 
array (
  0 => 
  array (
    'text' => 'Crm',
    'nodes' => 
    array (
      0 => 
      array (
        'text' => 'Model',
        'nodes' => 
        array (
          0 => 
          array (
            'text' => 'ShixinMaternalFamilyModel.class.php',
          ),
        ),
      ),
      1 => 
      array (
        'text' => 'View',
        'nodes' => 
        array (
          0 => 
          array (
            'text' => 'UserManagement',
            'nodes' => 
            array (
              0 => 
              array (
                'text' => 'detail_member.html',
              ),
              1 => 
              array (
                'text' => 'add_member.html',
              ),
              2 => 
              array (
                'text' => 'add_maternal.html',
              ),
              3 => 
              array (
                'text' => 'user_list.html',
              ),
            ),
          ),
        ),
      ),
    ),
  ),
),

),
下圖目錄是需要實(shí)現(xiàn)的效果:

試了很多種方法都沒(méi)實(shí)現(xiàn),文件的目錄層級(jí)是不固定的,文件路徑的頭文件名也是不固定的。。。

滿天的星座
滿天的星座

全部回復(fù)(1)
過(guò)去多啦不再A夢(mèng)

沒(méi)讀懂題目。。

最新下載
更多>
網(wǎng)站特效
網(wǎng)站源碼
網(wǎng)站素材
前端模板
關(guān)于我們 免責(zé)申明 意見(jiàn)反饋 講師合作 廣告合作 最新更新
php中文網(wǎng):公益在線php培訓(xùn),幫助PHP學(xué)習(xí)者快速成長(zhǎng)!
關(guān)注服務(wù)號(hào) 技術(shù)交流群
PHP中文網(wǎng)訂閱號(hào)
每天精選資源文章推送
PHP中文網(wǎng)APP
隨時(shí)隨地碎片化學(xué)習(xí)
PHP中文網(wǎng)抖音號(hào)
發(fā)現(xiàn)有趣的

Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號(hào)