0 && $place<10) && ($ttt[$place] != $x && $ttt[$place] != $o) && is_numeric($place) ) { $ttt[$place] = $player; } else { $GLOBALS["err"] = true; } return $ttt; } // function ttt_check($ttt) { $x = $GLOBALS["cross"]; $o = $GLOBALS["circl"]; //Horizontal if( $ttt[7] == $ttt[8] && $ttt[8] == $ttt[9] ) { return 1; } if( $ttt[4] == $ttt[5] && $ttt[5] == $ttt[6] ) { return 1; } if( $ttt[1] == $ttt[2] && $ttt[2] == $ttt[3] ) { return 1; } //Vertical if( $ttt[7] == $ttt[4] && $ttt[4] == $ttt[1] ) { return 1; } if( $ttt[8] == $ttt[5] && $ttt[5] == $ttt[2] ) { return 1; } if( $ttt[9] == $ttt[6] && $ttt[6] == $ttt[3] ) { return 1; } //Diagonal if( $ttt[7] == $ttt[5] && $ttt[5] == $ttt[3] ) { return 1; } if( $ttt[1] == $ttt[5] && $ttt[5] == $ttt[9] ) { return 1; } //Nobody won for($i=1;$i