if (isset($array[2])){
抛出错误
Cannot use isset() on the result of an expression (you can use "null !== expression" instead)
if (null !== $array[2]){
抛出提示
Notice: Undefined offset: 2 in /var/www/alt.php on line 144
对了,这家伙是数组,目的是检测该数组中某个 key 值是否存在,而不是检测某个变量是否有,应该用 array_key_exists()
if(array_key_exists('2', $array)){
果然不再有错误