PHP Version of SpaceFinder