时空行者

PHP
Linux

网页转PDF文件

服务器需要安装wkhtmltopdf, $str = 'xvfb-run --server-args="-screen 0, 1024x768x28" wkhtmltopdf http://xyz..com/test.html  test.pdf 2>&1'; exec($str, $out, $code);

2024年3月29日 1412点热度 阅读全文
Linux

FFmpeg视频切片

服务器需要配置FFmpeg,本人安装的版本:ffmpeg-5.1.1,配置的快捷命令:ffmpeg5 $videofile = "test.mp4"; $m3u8dir = str_replace(".mp4", "", $v )."/"; $m3u8file = $m3u8dir."index.m3u8"; if(!is_dir($m3u8dir)){ mkdir($m3u8dir,0777,true); system("chown -R www:www".$m3u8dir); } /** $str = 'ffm…

2024年3月29日 1124点热度 阅读全文
PHP

文件打包下载

//data目录下file文件夹打包下载; $zip = new ZipArchive; $zipfile = "xyz.zip"; $savePath = "data/"; $dirName = "file"; $res = $zip->open($savePath .$zipfile, ZipArchive::CREATE); if ($res === TRUE) { //增加文件夹下多文件保持结构:注意文件夹存在     addFileToZip($savePath, $zip);     $zip-&…

2024年3月29日 815点热度 阅读全文
PHP

序列化长度问题

function common_unserialize($str) {     if(empty($str)){         return '';     }     $str= preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $str );     $str= str_replace("\r", "", $str);     return unserialize($str); }

2024年1月31日 559点热度 阅读全文

COPYRIGHT © 2025 时空行者. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

皖ICP备16014035号-3