• 随手笔记
  • 库
  • 工具箱

PHP出现SSL certificate problem: unable to get local issuer certificate

无法获取本地颁发者证书当时用curl进行https的请求的时候,本地执行的php会抛出"SSL certificate: unable to get local issuer certificate"这个错误。这个错误主要是由于本地没有进行证书的签名导致的下载cert.pem,下载地址为: http://curl.haxx.se/ca/cacert.pem在php的配置文件中php.ini引入证书文件curl.cainfo = "E:\wamp\bin\php\cacert.pem"

于 2024-04-28 发布    浏览量60

php根据月份获取指定天数

function get_day($date) { $tem = explode('-' , $date); //切割日期 得到年份和月份 $year = $tem['0']; $month = $tem['1']; if( in_array($month , [1,3,5,7,8,10,12])){ $text = '31';// $text = $year.'年的'.$month.'月有31天'; }elseif( $month == 2 ){ //判断是

于 2024-04-28 发布    浏览量63

php处理远程图片本地化

//获取远程图片下载到网站中function Img_url($url){if($url==""):return false;endif; $path=date("Ymd"); //保存路径 if(!file_exists($path)) { //检查是否有该文件夹,如果没有就创建,并给予最高权限 mkdir("$path", 0700); //创建目录 } $n

于 2024-04-28 发布    浏览量60

php301重定向

//强制httpsif(!isset($_SERVER['HTTPS'])||$_SERVER['HTTPS']=='off'){ header("HTTP/1.1 301 Moved Permanently"); header('Location:https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']);}// 强制跳转到www$host = $_SERVER["HTTP_HOST"];$host = trim($host);if ($

于 2024-04-28 发布    浏览量89

PHP判断pc和手机端

//获取USER AGENT$agent = strtolower($_SERVER['HTTP_USER_AGENT']);//分析数据$is_pc = (strpos($agent, 'windows nt')) ? true : false; $is_iphone = (strpos($agent, 'iphone')) ? true : false; $is_ipad = (strpos($agent, 'ipad')) ? true : false; $is_android = (strp

于 2024-04-28 发布    浏览量75

PHP过滤标签

$str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格)$str=preg_replace("/<\!–.*?–>/si","",$str); //注释$str=preg_replace("/<(\!.*?)>/si","",$str); //过滤DOCTYPE$str=preg_

于 2024-04-28 发布    浏览量64

php date()时间参数

date('Y-n-d',time());a - "am" 或是 "pm" A - "AM" 或是 "PM" d - 几日,二位数字,若不足二位则前面补零; 如: "01" 至 "31" D - 星期几,三个英文字母; 如: "Fri" F - 月份,英文全名; 如: "January" h - 12 小时制的小时; 如: "01" 至 "12" H - 24 小时制的小时; 如: "00" 至 "23" g - 12 小时制的小时,不足二位不补零; 如: "1" 至 12" G - 24

于 2024-04-28 发布    浏览量60

打开或存储指定目录下的文件

/** * 打开目录中指定的文件 * file_get_contents 打开指定文件 * htmlspecialchars 转义 */header("Content-type:text/html; charset=utf-8"); //处理中文乱码$dir1 = $dir."article/index.htm";$content = htmlspecialchars(file_get_contents($dir1));//echo $content;/** * 把内容存入指定文件中 * file_put

于 2024-04-28 发布    浏览量58

获取指定目录下的所有文件

/* * $str_file定义空数组 * glob 获取文件目录,组成数组 * is_dir 判断是否是目录 * filesize()获取文件大小 单位B * fileatime():文件最后访问时间,返回时间戳 * filectime():文件最后改变时间,返回时间戳 * filemtime():文件最后修改时间,返回时间戳 */$dir = $_SERVER['DOCUMENT_ROOT']."/template/pc/";$str_file = $templates = array();$fil

于 2024-04-28 发布    浏览量58

通过文件大小换算单位

function size($int = 0){ if($int < 1024){ $t = $int.'k'; }elseif($int >= 1024 && $int < 1024*1024){ $t = round($int/1024,2).'kb'; }elseif($int >= 1024*1024 && $int < 1024*1024*1024){ $t = round(

于 2024-04-28 发布    浏览量71
上一页1234下一页

随手笔记

php  (36篇)

mysql  (1篇)

jquery  (12篇)

css  (2篇)

编译器  (1篇)

服务器  (1篇)

其它  (1篇)

最新笔记

js判读是否为手机端跳转

Windows永久暂停更新

kindeditor编辑器,视频格式embed改成video

php报错 syntax error, unexpected end of file

mysql 数据库备份、还原工具 mysqldump

本站用于学习记录 不接受任何法律责任 如有问题可留言到邮箱:cskfcxzh@126.com

Copyright © 2024 笔记记录 京ICP备19019380号-1