4月 27, 2019 - php开发, 开发笔记    strtotime(“0000-00-00 00:00:00”) 的坑已关闭评论

strtotime(“0000-00-00 00:00:00”) 的坑

想要的效果是当值为“0000-00-00 00:00:00”时,返回1;

     图一,在本地运行返回1,在服务器运行返回2

二、问题分析

1、一直以来的思维是strtotime("0000-00-00 00:00:00")的值为0,这样图一返回1

2、图二,在线php工具中运行,strtotime("0000-00-00 00:00:00")的返回值竟然为负值时间戳,!strtotime("0000-[……]

Read more

4月 22, 2019 - laravel, 循环遍历    无限极分类已关闭评论

无限极分类

API:获取无限极数,支持对parent_id(父级ID,最小0)和level(表示获取到第几层,最小1)的筛选
public function classificationSimple(Request $request)
{
    $this->validate($request, [
        'parent_id' => 'filled|integer',
        'level' => 'filled|integer',
    ]);
    $data = Classification::select('id', 'name_sc'[......]

Read more

3月 27, 2019 - 开发笔记    curl: (60) SSL certificate problem: unable to get local issuer certificate 错误已关闭评论

curl: (60) SSL certificate problem: unable to get local issuer certificate 错误

做微信分享时,碰到如下

SSL certificate problem: unable to get local issuer certificate。

的错误信息。

此问题的出现是由于没有配置信任的服务器HTTPS验证。默认,cURL被设为不信任任何CAs,就是说,它不信任任何服务器验证。

因此,这就是浏览器无法通过HTTPs访问你服务器的原因。


解决此报错有2种处理方法

  1.如果你的内容不敏感,一个快捷的方法是使用curl_exec()之前跳过ssl检查项。

  [……]

Read more

页面:«1...27282930313233...45»