I have a problem converting variables into an array.
I am running a foreach loop to get values from my multidimensional array $images which contains the image name, e.g.: "Item Blue.png" or "Item Light Oak.png" and an id of each image.
foreach ($images['images'] as $image) {
  $image_name = explode(" ", substr_replace($image->filename ,"",-4));
  if (!empty($image_name[2])) {
    $colour = ucfirst($image_name[1] . " " . $image_name[2]);
  }
  else {
    $colour = ucfirst($image_name[1]);
  }
}
$colour variable is giving me Color name and $image->id can give me image id.
I would like to build $colors array with above variables so that it would look like this:
$colors = array(
    'Blue' => 1620,
    'Green' => 1467,
);
Kind of like this:
$colors = array(
    '$colour' => $image->id,
);
I have no idea how to do this and I will appreciate any help to give me at least some directions.
