I tried to use and recursive function to create an nested array but i can't have access to the array pointer ( in deep levels ) in recursive functions.. don't know why.. maybe is the wrong patch to the answer. thank you,
If you split your string on the @, you can loop through each item and parse it correctly into your array.
unfortunately I can not change the string as it comes from a Windows program.
it is not formatted for php but there is a kind of rustic formatting.
I thought that an algorithm should work, but I can not make it reality:
1) explode the string @ this will give me two types of pieces:
a) Arrays as pieces that are: * [Item_1] [door] * [Mozart] [human] b) pieces that have the "=" in them are then: * [Mozart] [grass] = yes * [Mozart] [green] = no * [Blue] [movie] = yes * [Item_1] [beat] = yes * [Item_1] [music] = no
2) the algorithm:
1) create an empty array 2) foreach in the string piactes if piace_are_array and item_does_not_exist($tree) -> add_current_piece else if attibrute_existe -> append on it
if is_not_array -> append in the last attribute added.