Can you turn this string:
"package.deal.category"
Into an array like this:
$array['package']['deal']['category']
The value inside the index at this point can be anything.
Can you turn this string:
"package.deal.category"
Into an array like this:
$array['package']['deal']['category']
The value inside the index at this point can be anything.
What have you tried? The absolute answer to this is very easy:
$keys = explode('.', $string);
$array = array();
$arr = &$array;
foreach ($keys as $key) {
$arr[$key] = array();
$arr = &$arr[$key];
}
unset($arr);
...but why would this be useful to you?