Nasıl bir derin iç içe diziye birden dizeleri bölmek?

0 Cevap

Ben benzer birden çok dizeleri var:

$str = "/One/Two";
$str2 = "/One/Two/Flowers";
$str3 = "/One/Two/Grass";
$str4 = "/One/Another/Deeper";
$str5 = "/Uno/Dos/Cow";

Ben aşağıdaki benzer bir derin iç içe dizi bölmek istiyorum:

Array
(
    [One] => Array 
    (
        [Two] => Array
        (
            [Flowers] => 
            [Grass] => 
        )    
        [Another] => Array
        (
            [Deeper] => 
        )           
    )   
    [Uno] => Array 
    (
        [Dos] => Array
        (
            [Cow] => 
        )             
    )         
)

0 Cevap