I have the following code:
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("coockie");
$filename ="excelreport.xls";
$contents = "date \t ip \t visits \t \n";
$result=mysql_query("select * from test");
$mydate='';
$myip='';
$visits='';
while($data=mysql_fetch_assoc($result))
{
$mydate.=explode(",", $data['date']);
$myip.=explode(",", $data['ip']);
$visits.=$data['visits'];
}
print_r($mydate);
//header('Content-type: application/ms-excel');
//header('Content-Disposition: attachment; filename='.$filename);
//echo $contents;
?>
$mydate is outputted as string Array. I need it outputted like array of values. Any suggestions?