Tried searching but nothing was exactly what I was looking for.
I have a string that looks like this:
$string = "sku1,2|sku2,5";
I would like to convert it into a multi-dimensional array that would end up looking like this:
Array
(
[0] => Array
(
[sku] => sku1
[qty] => 2
)
[1] => Array
(
[sku] => sku2
[qty] => 5
)
)
So far I've tried using:
explode(',',$string);
Which is the right idea but it doesn't account for the pipe delimiter to know when to go to the next array group.