How to export word file stored as binary file from mySQL to my machine using php?

I have uploaded a word file to SQL database which is saved in binary form. I want to export that file to my machine in it’s original format using php. How to do it? I am using XAMPP.