如果你的数据一下形式的,可使用 ExcelHelper 导出标准文件 查询数据结果 $list =[ ['id'=>1,'name'=>'张三','idcard'=>'152622198901010000'], ['id'=>2,'name'=>'李四','idcard'=>'152622198901010001'], ];…
function getCsvData($filePath){ $handle = fopen( $filePath, "r" ); $data = []; while (!feof($handle)) { $rowData = fgetcsv($handle); $str = json_encode($rowData); $data …
public static function unzip_file(string $zipName,string $dest){ //检测要解压压缩包是否存在 if(!is_file($zipName)){ return false; } //检测目标路径是否存在 if(!is_dir($dest)){ mkdir($dest,0777,true)…
下载拓展包 composer require phpoffice/phpexcel 参考代码 //如果使用thinkphp5.1框架,则直接use即可 use PHPExcel_IOFactory; use PHPExcel; //实例化phpexcel对象 $objPHPExcel = new \PHPExcel(); //设置Excel属性 $…
string(15) "44621.526412037" string(19) "2022-03-01 12:38:01" gmdate("Y-m-d H:i:s",("execl读取出来的日期浮点数:44621.526412037" - 25569) * 86400)
$config=[ 'mode'=>'utf-8', 'useAdobeCJK'=>true, 'autoScriptToLang'=>true, 'autoLangToFont'=>true, 'useSubstitutions'=>true, 'format' => 'A5', 'orientatio…
1.CORS.PHP Access-Control-Allow-Origin 的值为*时 前端无法传入cookie,所以这里用配置文件做具体域名 1.在config/app.php 中配置容许跨域的域名 <?php return [ // +-----------------------------------------------…