Tic-tac-toe model and AI in PHP