I'm in need of some php superstars to convert this array :D Here's my current output.
Array(
[0] => Array(
[name] => S, M, L
[id] => 168, 169, 170
)
[1] => Array(
[name] => M, L
[id] => 169, 170
)
[2] => Array(
[name] => S
[id] => 168
)
[3] => Array(
[name] => S, M
[id] => 168, 169
)
)
The desired output from code above.
Array(
[0] => Array(
[name] => S,
[id] => 168
)
[1] => Array(
[name] => M,
[id] => 169
)
[2] => Array(
[name] => L
[id] => 170
)
)
Thank you in advanced!
idfor a givenname? It looks like that data came from an SQL query, why not just fetch theid/namepairs using another query on the same database?idandnamepairs in them, and you should just select from that. Otherwise, if you had no products withname = 'M', you might miss a value in your output array.