I'm trying to get my head around solving the following:
I have a string that has this pattern:
Category 1 > SubCategory 2 > SubSubCategory 3 > SubSubSubCategory 4 ... etc.
I am using the explode function by '>' to convert the string into an array. Now my final output should be something like this:
$categories[ 'Category 1' ][ 'SubCategory 2' ][ 'SubSubCategory 3' ][ 'SubSubSubCategory 4'][...etc...]
I assume I should be using a recursive function but I simply can't get my head around it. The solution should cater for an unlimited number of subcategories.
Any ideas?