Php to .xls format

Howdy people

Just wondering how would i go about getting php to export an excel format?

So an example would be.

Someone would go onto a site pull some information from a database then export as an execl file.

i don’t know myself yet want i need as fa as information in the file would be but just a jest would help me rolling on this.

Many thanks