excel 导出

admin2年前Laravel865
    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;

相关文章

生成唯一的订单号

public function get_order_sn() {     return date('Ymd') ...

腾讯云发送短信

<?phpnamespace App\Http\Controllers;use Illuminate\Http\Request;use Illuminate\Support\Facades\DB...

设置项目编号

$max = Db::table('member')->max('id') ?? 0; if ($max < 100000) { $cd = $this->create...

PHP 严格类型

只需在 PHP 代码文件的开头加上declare(strict_types = 1);这一行魔法代码,就能开启严格类型检查之旅。...

生成二维码

public function qrcode($uid){    require_once base_path() . '/public/phpqrcode/phpqrco...

小程序的二维码

    public function qrcode()    {        $qcode = "http...