-2
我想檢查6個字符串是否不相同。 我已經試過這樣:PHP多字符串比較
if($first != $second != $third != $four != $fifth != $sixth){}
但我得到的錯誤:
Parse error: syntax error, unexpected '!=' (T_IS_NOT_EQUAL)
我不知道誰可以做同樣的任何功能。
我想檢查6個字符串是否不相同。 我已經試過這樣:PHP多字符串比較
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';
}
這就是純粹的美麗 –
+1閱讀我的想法。 –
+1。毆打一拳。 –