I have try to write data to csv using the php function.
But the 0’s are truncate while write in to an csv.
$data = array ( 'aaa,bbb,ccc,dddd', '000123,456,789','"aaa","bbb"');
$fp = fopen('data.csv', 'w');
foreach($data as $line)
{
$val = explode(",",$line);
fputcsv($fp, $val);
}
fclose($fp);
if you are trying to open csv in excel or open office, it will truncate leading zeros.
when u construct the string with “\t” before zero to avoid 0 truncation