I have an array of makes and values printed as following:
$name='makemagento';
$attributeInfo = Mage::getResourceModel('eav/entity_attribute_collection')->setCodeFilter($name)->getFirstItem();
$attributeId = $attributeInfo->getAttributeId();
$attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);
$attributeOptions = $attribute ->getSource()->getAllOptions(false);
print_r($attributeOptions);
array($attributeOptions);
This gives me a list of results like this:
Array
(
[0] => Array
(
[value] => 1035
[label] => Alfa Romeo
)
)
I am trying to check if a value exists.
I do the following:
if (in_array('Alfa Romeo', $attributeOptions['label']))
{
echo "Match found";
}
else
{
echo "Match not found";
}
But i can't seem to successfully get a "match found" result from this.
Can anybody advise?