![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
易苒
这个作者很懒,什么都没留下…
展开
-
php 时间处理
(1)打印明天此时的时间戳strtotime("+1 day") 当前时间:echo date("Y-m-d H:i:s",time()) 结果:2016-06-22 09:40:25指定时间:echo date("Y-m-d H:i:s",strtotime("+1 day"))结果:2016-06-23 09:40:25 (2)打印昨天此时的时间戳strtotime("-1 day") ...原创 2018-06-22 16:50:15 · 250 阅读 · 0 评论 -
事务错误信息跳出(TP5)
//开启事务Db::startTrans();try{//参数1:返回的错误信息;参数2:返回的值.throw new \Exception('错误信息',1000);//事务提交Db::commit();return true;}catch (\Exception $e){//事务回滚Db::rollback();if ($e->getCode(...原创 2018-06-22 16:51:09 · 1729 阅读 · 0 评论 -
压缩文件封装的方法
################################################################function zip($dir_path, $zipName){ $relationArr = [$dir_path => [ 'originName' => $dir_path, 'is_dir' => true,...转载 2018-06-22 16:54:50 · 591 阅读 · 0 评论 -
base64图片处理
/** * @param $url * @param int $type * @param int $timeout * @return array */function base64EncodeImage ($url,$type=0,$timeout=30) { $msg = ['code'=>2100,'status'=>'error','msg'=>'未知错误!'];...转载 2018-06-22 16:55:37 · 807 阅读 · 0 评论 -
Category类库 无限分类
转载 2018-06-28 14:14:16 · 339 阅读 · 0 评论 -
数据库外网无法访问解决办法
数据库外网无法访问解决办法如果是阿里云购买的服务器,首先外网要能访问需要在阿里云里面设置安全策略80端口和3306如果mysql无法外网无法访问就需要修改配置文件my.cnf注释掉 skip-grant-tables skip-networking 这两个netstat -an | grep 3306 查看3306是否监控1.登录数据库mysql -u r...原创 2018-09-05 10:18:04 · 6519 阅读 · 1 评论 -
获取远程图片的宽高和体积大小(php封装方法)
/*** 获取远程图片的宽高和体积大小** @param string $url 远程图片的链接* @param string $type 获取远程图片资源的方式, 默认为 curl 可选 fread* @param boolean $isGetFilesize 是否获取远程图片的体积大小, 默认false不获取, 设置为 true 时 $type 将强制为 fread* ...转载 2018-10-18 10:06:01 · 433 阅读 · 0 评论