數據轉入到excel表格中

 header("Content-type:application/vnd.ms-excel");
 $filename='LBTX'.time();
 header("Content-Disposition:p_w_upload; filename=$filename.xls");
 echo '編號'.chr(9).'流水號'.chr(9).'用戶名'.chr(9).'手機號'.chr(9).'openid'.chr(9).'可提餘額'.chr(9).'提現金額'.chr(9).'發起時間'.chr(9).'最後操作時間'.chr(9).'提現狀態'.chr(13);
 foreach($list as $k=>$v){
    echo $v["withdraw_id"].chr(9);
    echo $v['trade_no'].chr(9);
   echo $v['user_name'].chr(9);
   echo $v['user_tel'].chr(9);
   echo $v['openid'].chr(9);
   echo $v['before_price'].chr(9);
   echo $v['price'].chr(9);
   echo $v['create_time'].chr(9);
   echo empty($v['done_time'])?$v['create_time'].chr(9):$v['done_time'].chr(9);
   echo $type[$v['withdraw_status']].chr(13);
  }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章