我想检查6个字符串是否不相同。我已经试过了:
if($first != $second != $third != $four != $fifth != $sixth){}
但是我得到了错误:
Parse error: syntax error, unexpected '!=' (T_IS_NOT_EQUAL)
我不知道有哪个功能可以做到这一点。
if (count(array_unique(array($first, $second, $third, $fourth, $fifth, $sixth)) == 6) {
echo 'All different';
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句