Solving a Maze with PHP