我正在创建一个 csv 文件,如下所示
$user_rep=Engine_Db_Table::getDefaultAdapter()->select()
->from('engine4_users',array('user_id','email','displayname'))
->query()->fetchAll();
$csv_output .= "UserId Email Name";
$csv_output .= "\n";
foreach($user_rep as $key)
{
$csv_output .=$key['user_id']." ".$key['email']." ".$key['displayname'];
$csv_output .= "\n";
}
$filename = $file."_".date("d-m-Y_H-i",time()); // il nome del file sara' composto da quello scelto all'inizio e la data ed ora oggi
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: csv" . date("Y-m-d") . ".csv");
header( "Content-disposition: filename=".$filename.".csv");
print $csv_output;
exit;
我正在获取 csv 文件。但我的数据上确实有空格作为名称。所以我越来越喜欢
实际上,名称是“测试智能代码”。我想在一个列上。我们怎样才能做到这一点?