在我的网站上,我有一个通过foreach
生成的产品列表,并创建了一个多维数组。在多维数组中搜索
阵列是这样的:(短) http://k44.kn3.net/73194E0F9.jpg
我需要将此多维数组中进行搜索,如果的["model"]
重复的值。
总之,我不想用相同的["model"]
阵列显示2个产品做定义:
foreach ($results as $result) {
$this->data['products'][] = array(
'product_id' => $result['product_id'],
'model' => $corto,
'thumb' => $image,
'Disponibilidad' => $rstock,
'name' => $nombre,
'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) . '..',
'price' => $price,
'special' => $special,
'tax' => $tax,
'rating' => $result['rating'],
'reviews' => sprintf($this->language->get('text_reviews'), (int)$result['reviews']),
'href' => $this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'])
);
}
403禁止 - 检查图像 – mleko
@mleko这里工作得很好。 – 13ruce1337
@ 13ruce1337现在也适用于我 – mleko