随笔分类 - PHP
PHP
摘要://导出excel表格 无限列 冻结首航 $saveType 1:给前端返回文件流 2保存到本地 $fileName 文件名 $headArr 首行的标题 $data 导出的数据 function getExcelOutByInfiniteColumnsOfFreezePane($saveType,
阅读全文
摘要:1.利用chrome浏览器 环境要求:需要PHP 7.4~8.2和Chrome/Chrmium 65+ (Linux服务器安装Chrmium) 2.安装 composer require chrome-php/chrome 3.使用 use HeadlessChromium\BrowserFacto
阅读全文
摘要:使用1.composer安装 composer require barryvdh/laravel-dompdf2.发布配置文件,生成的配置文件config/dompdf.php,也可选择忽略此步骤 php artisan vendor:publish --provider="Barryvdh\Dom
阅读全文
摘要:use GuzzleHttp\Client; //打包下载function downLoadPackage($fileData,$filePackage='document',$zipFileName='file'){ //存到 域名指向的public 目录 //1.先把远程文件下载到本地文件夹中
阅读全文
摘要:利用file_put_contents 下载文件 httpcopy("远程文件地址","本地下载得目录和文件名"); function httpcopy($url, $file="", $timeout=60) { $file = empty($file) ? pathinfo($url,PATHI
阅读全文
摘要:错误信息: Swift_TransportException Connection could not be established with host smtp.126.com :stream_socket_client(): SSL operation failed with code 1. O
阅读全文
摘要:$array = array( 'Name'=>'络恩', 'Age'=>24); $post=my_json_encode($array); // 这个函数是判断版本,如果是搞版本的则直接用版本带的函数处理,如果不是则用递归处理function my_json_encode($p){ if (PH
阅读全文
摘要:/** * 时间格式化 * @param string $dateformat 时间格式 * @param int $timestamp 时间戳 * @param int $timeoffset 时区偏差 * @return string */ function qgmdate($dateforma
阅读全文
摘要:<?php /** * 验证一个值是否在多维数组中 * @param string $str 要验证的值 * @param array $arr 多维数组 * */ function valueInArr ($str,$arr){ foreach ($arr as $v) { if(is_array
阅读全文
摘要:1.nginx的配置如下: location ^~ /images/ { set $memcached_key "$uri"; #用URI作为key去memcached中去读取内容 memcached_pass 127.0.0.1:11211; memcached_connect_timeout 5
阅读全文
摘要:<?php //连接Memcache$mem = new Memcache;$mem->connect("localhost", 11211) or die ("Could not connect");//保存数据$mem->set('key1', 'This is first value', 0,
阅读全文

浙公网安备 33010602011771号