Yve*_*eth -2 php string compare
我想检查6个字符串是否不一样.我试过这个:
if($first != $second != $third != $four != $fifth != $sixth){}
Run Code Online (Sandbox Code Playgroud)
但我收到错误:
Parse error: syntax error, unexpected '!=' (T_IS_NOT_EQUAL)
Run Code Online (Sandbox Code Playgroud)
我不知道任何能做同样事情的功能.
if (count(array_unique(array($first, $second, $third, $fourth, $fifth, $sixth)) == 6) {
echo 'All different';
}
Run Code Online (Sandbox Code Playgroud)