Hi,
I have made a file on excel. But I have to use this file in PHP. Is there any possible way to convert excel file into PHP. Please inform me how to export excel with php. I want some simple & fast software that can export the data and can apply simple formatting.
I want to export excel data file with php format
Hi there,
I hope you already know much about PHP programming language, so that I am not explaining so much about PHP code here. But if you think that you need help understanding the whole thing from the beginning, please just ask me. Now in below I am giving some instruction and code follow the instruction and copy the code to connect excel file with PHP code.
1. Go to start menu, click on control panel and in search write ODBC.
2. You will get a box, in that setup a system DNS.
3. Suppose you gave that a name, called “excelsheet”.
4. Now just copy this below code to connect to the excel file.
$conn=odbc_connect('excelSheet','','');
$query="SELECT * FROM sheet1";
$result=odbc_exec($conn,$query);
while (odbc_fetch_row($result))
{
$field1=odbc_result($result,1);
}
odbc_close($conn);
Best regards,
Riley Weaver.