摘要: 使用composer安装mpdf,选择适合自己的版本: https://packagist.org/packages/mpdf/mpdf 手册: http://mpdf.github.io/ 本文使用的mpdf版本:7.0 基本使用: $mpdf = new Mpdf(); $mpdf->Write 阅读全文
posted @ 2021-12-02 10:42 一剑还 阅读(2369) 评论(0) 推荐(0) 编辑
摘要: 需要自己去下载,只需要 phpqrcode.php 就行了 https://github.com/t0k4rt/phpqrcode 引入: require_once('../phpqrcode.php'); 使用例子: $str = 'hello world'; $file_path = $_SER 阅读全文
posted @ 2021-12-01 16:51 一剑还 阅读(57) 评论(0) 推荐(0) 编辑
摘要: $name = "test_".time().'.txt';//文件名 $path = $_SERVER["DOCUMENT_ROOT"] . "/test/";//绝对路径 //判断目录是否存在 不存在就创建 if (!is_dir($path)){ mkdir($path, 0777, true 阅读全文
posted @ 2021-12-01 16:20 一剑还 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 使用tp3的 Image 类,text 方法加文字水印,设置了字体,但是中文乱码,解决办法: https://blog.csdn.net/weixin_31939387/article/details/115989151 记录一下 阅读全文
posted @ 2021-10-29 09:41 一剑还 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 获取月: $start_year = '2020';//开始年 $start_month = '01';//开始月 $end_year = '2021';//结束年 $end_month = '09';//结束月 $date_arr = [];//保存结果的数组 if ($start_year == 阅读全文
posted @ 2021-09-23 16:07 一剑还 阅读(718) 评论(1) 推荐(0) 编辑
摘要: //导出的数据源 二维数组 $data = [ ['name' => '1','phone' =>'1的电话','pic_url' =>[]], ['name' => '2','phone' =>'2的电话','pic_url' =>[]] ]; //设置参数 $indexKey = ['name' 阅读全文
posted @ 2021-01-12 15:20 一剑还 阅读(589) 评论(0) 推荐(0) 编辑
摘要: /** * 通用导出 * array $data 导出数据 * array $indexKey 导出数据键 * array $headArr 表头 * string $title 生成文件名 * * 必须保持 $indexKey 和 $headArr 顺序对应才能保证导出数据准确 */ functi 阅读全文
posted @ 2020-08-27 11:34 一剑还 阅读(419) 评论(0) 推荐(0) 编辑
摘要: tp3和tp5,两个版本的读取表格文件是一样的: import("Org.Util.PHPExcel"); import("Org.Util.PHPExcel.IOFactory"); //获取文件类型 $file_path是文件的路径 $inputFileType = \PHPExcel_IOFa 阅读全文
posted @ 2020-06-28 17:01 一剑还 阅读(267) 评论(0) 推荐(0) 编辑
摘要: 之前写切库都是M方法切的:M('test',$prefix,$config)->find() 突然遇到一个使用db切的:$db_obj = $this->db($number, $config); $db_obj->table('test')->find() 这个切库原本是在一个接口里,所以一直没什 阅读全文
posted @ 2020-05-06 10:45 一剑还 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 最近因为一些特殊原因,了解了一下python,并且做了一个简易爬虫,目标是知乎。 注*:博主并没有深入学习python,只是了解了一下基本用法,如变量类型、循环、判断,然后使用了一下python的工具,博主对这些工具也不太了解,博主的代码仅限于实现功能,如有关于python的问题,请不要问博主。博主 阅读全文
posted @ 2020-01-07 14:40 一剑还 阅读(485) 评论(0) 推荐(0) 编辑