I have this array:

There are many ['variants'] below.
I need to create a new array like this:

from all ['variants'].
I have a function with this
$variants = array();
$features = $features['18']; foreach ($features as $feature) {
if (!empty($feature['variants'])) {
$variants = array_merge($variants, $feature['variants']);
}
}
fn_print_r($variants);
return $variants;
But it have error: array_merge() [function.array-merge]: Argument #2 is not an array.
How can I fix this?
18? And what exactly is in$featuresbefore you loop over it?variants, since you only have it once in your array. Why not just do$variants = $features["variants"];?array_values(), e.g.$variants = array_values($features["variants"]);