随笔分类 -  php

摘要:1.web资源防盗链 盗链概念 盗链是指在自己的页面上展示一些并不在自己服务器的内容 防盗链工作原理 通过referer或者签名,网站可以检测目标网页访问的来源页,一旦检测到来源页不是本站即进行阻止或者返回指定页面 解决方案1 Referer nginx 模块ngx_http_referer_mod 阅读全文
posted @ 2018-03-05 16:25 spectrelb 阅读(3052) 评论(0) 推荐(0)
摘要:转载自:https://www.cnblogs.com/penghuwan/p/6884932.html undefined 阅读全文
posted @ 2018-02-28 13:43 spectrelb 阅读(191) 评论(0) 推荐(0)
摘要:把该文件 http://pan.baidu.com/s/1dFnO6nZ 放入www目录,然后新建一个test.php文件,复制以下代码,可以进行测试 阅读全文
posted @ 2017-11-15 14:58 spectrelb 阅读(813) 评论(0) 推荐(0)
摘要:<?php function getMillisecond() { $time = explode ( " ", microtime ()); $time = $time[1] . ($time[0] * 1000); $time2 = explode( ".", $time ); $time = $time2[0]; return $time; } ... 阅读全文
posted @ 2017-11-14 17:03 spectrelb 阅读(482) 评论(0) 推荐(0)
摘要:getConstants(); return $constants; } } var_dump(Test::all()); //打印结果如下: //array (size=6) // 'A' => string '1' (length=1) // 'B' => string '2' (length=1) // 'C' => string '3' (length=1... 阅读全文
posted @ 2017-11-14 16:43 spectrelb 阅读(373) 评论(0) 推荐(0)
摘要:效果图如上: 实现思路,写个shell脚本,然后php 去执行: 通过端口和进程来判断,脚本实现: 阅读全文
posted @ 2017-09-06 14:20 spectrelb 阅读(640) 评论(0) 推荐(0)
摘要:本地开了 Shadowsocks,然后postman模拟的twitter的接口是请求成功的,然后用php-curl去请求网址,出现以下错误 检查是 curl没有使用代理,在里面加上如下2行 阅读全文
posted @ 2017-08-30 10:46 spectrelb 阅读(708) 评论(0) 推荐(0)
摘要:/** * PHP计算两个时间段是否有交集(边界重叠不算) * * @param string $beginTimeOne 开始时间1 * @param string $endTimeOne 结束时间1 * @param string $beginTimeTwo 开始时间2 * @param string $endTimeTwo 结束时间2 * @return bool */ p... 阅读全文
posted @ 2017-08-11 17:57 spectrelb 阅读(357) 评论(0) 推荐(0)
摘要:https://github.com/serbanghita/Mobile-Detect/ 阅读全文
posted @ 2017-07-25 15:02 spectrelb 阅读(182) 评论(0) 推荐(0)
摘要:使用redis的有序集合, Zincrby https://redis.io/commands/zincrby 使用的symfony框架的这个方法,会返回接口名称 阅读全文
posted @ 2017-07-25 13:48 spectrelb 阅读(8389) 评论(0) 推荐(0)
摘要:转载:http://www.laruence.com/2012/01/10/2469.html 阅读全文
posted @ 2017-07-21 18:15 spectrelb 阅读(170) 评论(0) 推荐(0)
摘要:转载自:http://www.laruence.com/2013/03/26/2884.html 阅读全文
posted @ 2017-07-21 18:07 spectrelb 阅读(172) 评论(0) 推荐(0)
摘要:转载:http://www.laruence.com/2012/10/16/2831.html 阅读全文
posted @ 2017-07-21 18:06 spectrelb 阅读(166) 评论(0) 推荐(0)
摘要:非常棒的一个微信公众号 转载地址:http://mp.weixin.qq.com/s/eDMV25YqCPYjxQG-dvqSqQ 一、缘起 很多时候,业务有“在一段时间之后,完成一个工作任务”的需求。 例如:滴滴打车订单完成后,如果用户一直不评价,48小时后会将自动评价为5星。 一般来说怎么实现这 阅读全文
posted @ 2017-07-17 21:41 spectrelb 阅读(271) 评论(0) 推荐(0)
摘要:array_change_key_case array_chunk array_column array_combine array_count_values 阅读全文
posted @ 2017-06-23 17:09 spectrelb 阅读(144) 评论(0) 推荐(0)
摘要:主要使用到了 php 的时间函数 mktime。 官方文档:http://kr1.php.net/manual/zh/function.mktime.php 1 //获取今天00:00 2 $todaystart = strtotime(date(‘Y-m-d’.’00:00:00′,time()) 阅读全文
posted @ 2017-06-20 18:11 spectrelb 阅读(4984) 评论(1) 推荐(1)
摘要:https://yq.aliyun.com/articles/44246 下载代码: 在你项目的External Libraries上右键->Configure PHP Include Path然后选择那个文件夹(swoole-ide-helper)就可以了 阅读全文
posted @ 2017-06-20 14:26 spectrelb 阅读(1293) 评论(0) 推荐(0)
摘要:http://www.jianshu.com/p/fedbb9d2d999 阅读全文
posted @ 2017-06-20 11:58 spectrelb 阅读(213) 评论(0) 推荐(0)
摘要:https://www.xxling.com/blog/article/3106.aspx 阅读全文
posted @ 2017-06-09 15:42 spectrelb 阅读(647) 评论(0) 推荐(0)