你可以试试这个
foreach(explode(',', $sEmailAddresses) AS $sEmailAddress) { $bValid |= filter_var($sEmailAddress, FILTER_VALIDATE_EMAIL); } $sResult = ($bValid) ? 'Both are valid' : 'One of them are not';