# cls();
You clear the screen too soon. You should store the results in a variable, then print after the cls.
Also, the game continues even if someone wins. You need an exit condition.
I got a draw with this sequence: 123465798
See also: Basic debugging checklist
Check out Conditional Operator for assigning to $player.
In reply to Re: TicTacToe Code Help.
by toolic
in thread TicTacToe Code Help.
by Jsamp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |