I have a simple script that outputs data from my database to a CSV file.
My problem is that when I export mobile numbers, excel sees them as long integers and displays them in scientific notation.
If I go to format cells and change it to a number they all display fine.
Is there a way to set the column as a integer without changing it in excel.
Here is my code:
header('Content-Type: text/csv; charset=utf-8');
header('Content-Disposition: attachment; filename=data.csv');
$output = fopen('php://output', 'w');
fputcsv($output, array('Book Reference','Company','Type','Site Name', 'Date', 'Time', 'Name', 'Email', 'Mobile', 'Team ID'));
Below is the code that sits inside my while loop
// THIS IS WHERE I SET VARIABLES
fputcsv($output, array($booking_reference,$company,$type,$site_name,$date,$time,$name,$email,$mobile,$team_id));