I am trying to see if an array contains a specific set of strings. In my specific situation, I have an array that contains customer addresses. I am trying to see if every address is a PO Box or not. I want to print an error message if all of their addresses are PO Boxes.
This is what I currently have.
public function checkPhysicalAddressOnFile(){
$customer = Mage::getSingleton('customer/session')->getCustomer();
foreach ($customer->getAddress() as $address) {
if stripos($address, '[p.o. box|p.o box|po box|po. box|pobox|post office box]') == false {
return false