php carbon 计算2个日期之间的天数

2-28 5,120 views

<?php $date1 = \Carbon\Carbon::parse('2020-03-05 11:00:00'); $date2 = \Carbon\Carbon::parse('2020-03-10 11:00:00'); $diff =...
阅读全文 0

php使用生成器读取超大文件

2-08 1,866 views

<?php function getLines($file) { $f = fopen($file, 'r'); try { while ($line = fgets($f)) { yield $line; ...
阅读全文 0

php获取字符串里面的图片,xpath方式

1-31 1,953 views

代码 <?php $html = <<<str <html> <head> <title>123</title> </head> <body> <img src=&quo...
阅读全文 0

centos 安装redis 5.0

1-10 1,934 views

参考:https://redis.io/download $ cd /apps/softs/ $ wget http://download.redis.io/releases/redis-5.0.5.tar.gz $ tar xzf redis-5.0.5.tar.gz $ cd red...
阅读全文 0

Thinkphp5 in查询结果按照in里面的顺序排

1-09 3,391 views

或许有人会注意过,但我以前真不知道 SQL: select * from table where id IN (3,6,9,1,2,5,8,7); 这样的情况取出来后,其实,id还是按1,2,3,4,5,6,7,8,9,排序...
阅读全文 0

一款好用的sitemap 生成类库 samdark/sitemap

1-07 1,906 views

github地址 安装 composer require samdark/sitemap 使用 use samdark\sitemap\Sitemap; use samdark\sitemap\Index; // create sitemap $sitemap = new Sit...
阅读全文 0

Mysql事务的四种隔离级别(转)

1-02 1,882 views

转载地址(click me) 数据库事务的隔离级别有4种,由低到高分别为Read uncommitted 、Read committed 、Repeatable read 、Serializable 。而且,在事务的并...
阅读全文 0

一个好用的 php websocket 类库 ratchet

12-25 3,249 views

github 官网 安装 //安装 composer require cboden/ratchet 创建自己的websocket类库 <?php namespace MyApp; use Ratchet\MessageComponentInterface; us...
阅读全文 0

一款非常好用的jquery滚动条样式插件 jquery.nicescroll

12-25 2,090 views

github地址 demo 使用方法 //默认 $(".do-nicescrol").niceScroll(); // $(".do-nicescrol").niceScroll({ cursorcolor:"aquam...
阅读全文 0

一个好用的图片裁剪,水印类 intervention/image,支持gd库和image和imagick

12-04 2,186 views

安装 composer require intervention/image 使用文档:http://image.intervention.io/getting_started/introduction 类库 <?php /* * 图片处理 */ name...
阅读全文 0