file_get_contents(); if needed. (See explanation below)
After the table is succesfully converted to excel, I upload that excel file to server and using PHPExcel plugin i try to view this excel file's content, but an errors shows up. It says your file is not readable. Is there any way to make our .xls files readable (creating proper* excel files via table2excel) upon converting table to excel? Thanks in advance.
They aren't .xls files, they are .xlsx so as simple as it sounds, you might want to start by ensuring they're named properly. Also, this is a bit of a hack using borrowed code and I can imagine the files aren't as well-formed as they could be. I'll see about investigating the format further.
When it was xlsx, my excel(2013) was giving a warning about filetype so I changed it into xls. That's why I keep mentioning the extention as xls :) Sorry if I caused a misunderstanding.