I need to search all products by a product attribute in Magento. Magento provides a loadByAttribute function which gives all products match the passed attribute. You just need to pass attribute name and its value in the function. You can see the below example to get more idea.
$products = Mage::getModel(‘catalog/product’)->loadByAttribute(‘attribute_name’, $attribute_value);