foreach ($this->getGalleryImages() as $_image){
$a=explode('/',$_image->getPath());
$b=explode('-',$a[count($a)-1]);
$colors[]=$b[1];
}
に変更できない$colors[]=$b[1];
理由$colors=$b[1];
。しかし、$color=array_unique($colors);
これは大丈夫です。$color ありません[]
($color[])