Source:
Convert your PHP print_r to XLSX (Excel spreadsheet format) file directly within a Web browser.
You can use this for the Array data type where you have a standard table (2 dimensional array) or even for multiple tables (3 dimensional array where the first key is the name of the sheet). You can see more about the options by clicking to the examples above.