raj_2006
09-24-2006, 08:20 AM
Hi all,
I am writing the DB data in a csv file using php.But the header column/cell needs to be increased in the csv file.
Is there any way to fix the width of each column of the header in csv file.
my code snippets looks like this
$file_pointer=fopen("transaction.csv", "w");
fwrite($file_pointer,"TRANSACTION ID,USERNAME,TRANSFER TO,DATE,AMOUNT,FEES,STATUS,NOTE\n");
..............
................
.................//while looping is going on
{
//fetching the fields
fwrite($file_pointer,"\n$TranId,$EmailId,$TransfferTo,$Date,$Amount,$Fees,$Status,$Note\n");
}
Please suggest if there is any way.
Thanks for your co-operation in advance.
Raj
I am writing the DB data in a csv file using php.But the header column/cell needs to be increased in the csv file.
Is there any way to fix the width of each column of the header in csv file.
my code snippets looks like this
$file_pointer=fopen("transaction.csv", "w");
fwrite($file_pointer,"TRANSACTION ID,USERNAME,TRANSFER TO,DATE,AMOUNT,FEES,STATUS,NOTE\n");
..............
................
.................//while looping is going on
{
//fetching the fields
fwrite($file_pointer,"\n$TranId,$EmailId,$TransfferTo,$Date,$Amount,$Fees,$Status,$Note\n");
}
Please suggest if there is any way.
Thanks for your co-operation in advance.
Raj