PHP Minesweeper implementation