excel 导出

admin8个月前Laravel405
    header("Content-Type: application/vnd.ms-excel; name='excel'"); header("Content-Disposition:attachment;filename=" . date('Y-m-d', time()) . "商品订单.xls"); echo <<< EOT <html xmlns:o="urn:schemas-microsoft-com:office:office"  xmlns:x="urn:schemas-microsoft-com:office:excel"  xmlns="http://www.w3.org/TR/REC-html40"> <head><meta http-equiv="Content-type" content="text/html;charset=utf-8" /></head> <body>  <table border="1" width="80%">  <tr>  <td align="center">档口</td>  <td align="center">商品</td>  <td align="center">下单时间</td>  <td align="center">导出时间</td>  </tr> EOT; foreach ($list as $row) { echo <<< EOT  <tr>  <td align="center">{$row["title"]}</td>  <td align="center">{$row["data"]}</td>  <td align="center">{$row["date"]}</td>  <td align="center">{$row["time"]}</td>  </tr> EOT;
        } echo <<< EOT </table> </body> </html> EOT;

相关文章

php 优化

使用 gc_collect_cycles() 强制进行垃圾回收 PHP 的垃圾回收机制会自动释放不再使用的变量所占用的内存。然而,在某些情况下,尤其是在长时间运行的脚本(如 CLI...

解密微信绑定的手机号

public function mobile() { $code = request()->input('code'); if (!$code) { return $this-&...

修改密码

/** * 修改密码 */publicfunction setpass(){    $type = request()->input('type');// 1...

手机号替换

 $vv = substr_replace($vv, '****', 3, 4) ....

微信支付V3

 public static function pay($order_sn = '11111', $money = '12', $uid = 7) ...

微信退款v3

/** * 微信 退款 操作 */ public function refund($out_trade_no, $refund_money) { $time = time();...