- 博客(6)
- 收藏
- 关注
原创 thinkphp6 过滤XSS攻击 详解
首先使用composer执行命令composer require ezyang/htmlpurifier在app/common.php公共文件中定义remove_xss函数if (!function_exists('remove_xss')) { //使用htmlpurifier防范xss攻击 function remove_xss($string){ //相对index.php入口文件,引入HTMLPurifier.auto.php核心文件 .
2021-12-15 17:24:17
711
原创 Thinkphp6 七牛云图片上传 详解
首先获取Access Key和Secret KeyComposer下载composer require lorine/oss-utils上代码use Lorine\OssUtils\OssService; $config = [ 'ak' => 'xxxxxx',//SecretId /Access_Key 'sk' => 'xxxxxx',//SecretKe /Secret_Key...
2021-12-14 18:20:52
841
原创 thinkphp6 Excel导入导出 包含图片
composer下载composer require phpoffice/phpspreadsheetpublic function export() { $data = $this->model->field('type_name,image,statusswitch')->select(); //创建一个新的excel文档 $newExcel = new Spreadsheet(); /.
2021-12-12 21:16:58
862
2
原创 thinkphp6 Excel导入导出 详解
composer下载composer require phpoffice/phpspreadsheet导入导出<?phpnamespace app\index\lib;use PhpOffice\PhpSpreadsheet\Cell\Coordinate;use PhpOffice\PhpSpreadsheet\IOFactory;use PhpOffice\PhpSpreadsheet\Spreadsheet;use think\exception\Validate.
2021-12-01 16:48:51
611
原创 无限级分类 详解
if(!function_exists("get_cate_list")){ //返回无限级分类菜单 function get_cate_list($list,$pid=0,$f=0){ //声明一个静态数组存储处理后的数据 static $arr = []; foreach($list as $val){ if($val['pid']==$pid){ $val['level'] ...
2021-11-28 14:45:25
591
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人