美化带有可变键的数组路径

时间:2014-12-28 19:25:35

标签: php arrays

如何解决此问题:

Array
(
    [0] => 1.0 - Classic
    [1] => 1.0 - Legends of Azeroth
    [2] => 01. Main Theme.mp3
)

进入:

1.0 - Classic/1.0 - Legends of Azeroth/01. Main Theme.mp3

注意:

There may be more than 3 keys.

1 个答案:

答案 0 :(得分:1)

尝试implode(a / k / a join):

implode('/', $theArray);