随笔分类 - php
摘要:<VirtualHost *:80> DocumentRoot /opt/www/ ServerName xxx.com ErrorLog logs/xxx.com-error_log CustomLog logs/xxx.com-access_log combined #<Location /sc
阅读全文
摘要:composer clear-cache
阅读全文
摘要:这是 SSL 证书问题所致,在使用 SDK 调用微信支付等相关的操作时可能会遇到报 “SSL certificate problem: unable to get local issuer certificate” 的错误。 微信公众平台提供的文档中建议对部分较敏感的操作接口使用 https 协议进
阅读全文
摘要:由于array_key_exists不支持多维数组,只查到一维的,所以这个版本兼容
阅读全文
摘要:wget http://am1.php.net/get/php-7.1.4.tar.gz/from/this/mirror tar -xf mirror cd php-7.1.4/ yum -y install libjpeg libjpeg-devel libpng libpng-devel fr
阅读全文
摘要:目的: 为了避免使用标准方法(新Foo())创建对象的成本,从而创建一个原型,并克隆它 应用场景: 大量数据 (例如在数据库中通过 ORM 创建100000行数据)
阅读全文
摘要:1.目的: 在应用程序中只有一个该对象的实例,该对象将处理所有调用 2.场景举例: 数据库连接 记录器 应用程序的锁文件 3.UML 图: 4.类和方法:
阅读全文
摘要:1 class Stack 2 { 3 private $_data = []; 4 private $_end = null; 5 6 public function push($data) 7 { 8 if($this->_end null) 9 $this->_end = 0; 10 else
阅读全文
摘要:1 function listFiles($from='.'){ 2 if(!is_dir($from)) return false; 3 $files = []; 4 $dirs = array($from); 5 while(null !== ($dir=array_pop($dirs))){ 6 if($dh = opendir(...
阅读全文
摘要:yum -y install gcc-c++ wget http://nginx.org/download/nginx-1.11.4.tar.gz wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz wget http://120.52
阅读全文
摘要:1 function fib($n) 2 { 3 $cur = 1; 4 $prev = 0; 5 for ($i = 0; $i < $n; $i++) { 6 yield $cur; 7 8 $temp = $cur; 9 $cur = $prev + $cur; 10 ...
阅读全文
摘要:1 方法一: 2 class foo { 3 static public function test() { 4 var_dump(get_called_class()); 5 } 6 } 7 8 class bar extends foo { 9 } 10 11 foo::test(); 12 bar::test(); 13 14 输出:...
阅读全文
摘要:1 //查询文件扩展名 2 function extension($str){ 3 $str = implode("",explode("\\",$str)); 4 $str = explode(".",$str); 5 $str = strtolower(end($str)); 6 return $str; 7 } 8 9 $file = '...
阅读全文

浙公网安备 33010602011771号