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);
}
转载于:https://blog.51cto.com/laotouzi/1883281