How to write to text file after fetching the data from database

Hi

all

I want to write a text file in php after fetching the data from mysql table,
because I want to print that data to pdf file.

Please help me out

Thanks
MD.Samiuddin

With functions such as ‘fopen’, ‘fwrite’, fclose and other File System functions.


file_put_contents('file.txt', $data);