PHP黑科技之:不使用PHPEXCEL插件实现导出EXCEL功能
#导出
public function exprot_cash_list($data,$title=''){
$html = '';
$html .= '
$html .= '
'.$title.'明细';$html .= '
';// $html .= '
到账时长';$html .= '
用户手机';$html .= '
姓名';$html .= '
提现数额';$html .= '
手续费';$html .= '
到账数额';$html .= '
消耗资产';$html .= '
资产价格';$html .= '
账号信息';$html .= '
状态';$html .= '
添加时间';$html .= '
';foreach ($data as $key => $val) {
$html .= '
';// $html .='
'.get_cash_type($val['type']).'';$html .='
'.$val['mobile'].'';$html .='
'.$val['realname'].'';$html .='
'.$val['money'].'';$html .='
'.$val['fee'].'';$html .='
'.($val['money']-$val['fee']).'';$html .='
'.turnDecimal($val['money'] / $val['shop_ticket_price']).'';$html .='
'.$val['shop_ticket_price'].'';$html .='
'.$val['account'].'';$html .='
'.get_state($val['state']).'';$html .='
'.$val['addtime'].'';$html .= '
';}
$html .= '
';header('Content-Type: application/vnd.ms-excel; charset=utf-8');
header('Cache-Control: no-cache, must-revalidate');
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition:attachment; filename="'.$title.'明细.xls"');
echo $html;
}