got a collection of objects which have an item called path, which has a kind of folding set by a string like: $path = '/some/sub/any/path/'
now I need to create an array from that string like:
array(
'some'=>array(
'sub'=>array(
'objects'=>array(
array('id'=>1),
array('id'=>4)
),
'any'=>array(
'path'=>array(
'objects'=>array(
array('id'=>2),
array('id'=>3)
)
)
)
)
)
);
Actually I am looking for the best practice.
Any Idea, how to solve this in PHP?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…