Flood fill algorithm on php