Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $combination = '1/2/3/2/3/1/1/3/2/4/5/6/5/6/4/4/6/5/';
- $combination .= '7/8/9/8/9/7/7/9/8/1/4/7/4/7/1/1/7/4/';
- $combination .= '2/5/8/5/8/2/2/8/5/3/6/9/6/9/3/3/9/6/';
- $combination .= '1/5/9/5/9/1/1/9/5/2/5/7/5/7/2/2/7/5';
- $moves = array_chunk(explode('/', $combination), 3);
- foreach ($moves as $move) {
- if ($_SESSION['board'][$move[0]] == 'x' && $_SESSION['board'][$move[1]] == 'x' && $_SESSION['board'][$move[2]] == '') {
- unset($_SESSION['_board'][$move[2]]);
- $_SESSION['board'][$move[2]] = 'o';
- header("Location: index.php");
- exit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement