I'm trying to achieve a nice looking multidimensional array, removing the duplicate keys and having those as a master key with the values as another child array.
This is my starting array:
Array
(
[0] => Array
(
[pa_flavour] => 101
)
[1] => Array
(
[pa_flavour] => 102
)
[2] => Array
(
[pa_flavour] => 103
)
[3] => Array
(
[pa_flavour] => 104
)
[4] => Array
(
[pa_flavour] => 100
)
[5] => Array
(
[pa_bottle-size] => 108
)
[6] => Array
(
[pa_nicotine-strength] => 109
)
[7] => Array
(
[pa_nicotine-strength] => 110
)
)
And this is what I'm trying to achieve:
Array
(
[pa_flavour] => [
101,
102,
103,
104,
100
],
[pa_bottle-size] => [
108
],
[pa_nicotine-strength] => [
109,
110
]
)
I've followed multiple tutorials and used various functions from similar questions, but none of them seem to be working for me. Any ideas?
Thanks in advance.