<?php function checkPhysicalAddressOnFile($addresses) { return (bool) count(array_filter($addresses, function($address) { return !preg_match("/p\.o\. box|p\.o box|po box|po\. box|pobox|post office box/i", $address); })); } echo "First test:\n"; var_dump(checkPhysicalAddressOnFile([ "P.O. box 123", "123 Main St" ])); echo "\nSecond test:\n"; var_dump(checkPhysicalAddressOnFile([ "P.O. box 123", "Post Office Box 999" ]));
You have javascript disabled. You will not be able to edit any code.