0
我想查看数组是否包含特定的一组字符串。在我的具体情况中,我有一个包含客户地址的数组。我试图看看每个地址是否是邮政信箱。如果所有地址都是邮政信箱,我想打印一条错误消息。PHP请参阅如果数组中包含所有值包含字符串
这是我现在拥有的。
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
我将其标记为最佳答案!谢谢! – djames