How did scientists discover that the earth was not flat?

Hundreds of years ago peoplebelieved that the Earth was completely flat and if you sailed to far then you would fall of the edge, a little like disc-world in the Terry Pratchett books. But with danger comes bravery, and soon enough brave explorers travelled the world in search of the edge and realised it was in a sphere shape. Until recently when we went into space we had no idea exactly what our Earth looked like.