上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 41 下一页
摘要: symfony中服务的使用总所周知的方便,但是当一个controller多次使用到同一个服务的时候就会出现在每个Action中都get获取服务,此时为了省事相信你也尝试使用构造函数申明一个私有对象避免多次使用,如果服务没问题此时使用 private $conn; private $sql; publ 阅读全文
posted @ 2020-08-24 18:02 study_php_java_C++ 阅读(187) 评论(0) 推荐(0) 编辑
摘要: <?php //$result=httpcopy('http://www.phpernote.com/image/logo.gif'); echo '<pre>';print_r($result); function httpcopy($url,$file='',$timeout=60){ $fil 阅读全文
posted @ 2020-08-21 08:25 study_php_java_C++ 阅读(537) 评论(0) 推荐(0) 编辑
摘要: PHP不提供精度高于微秒的函数。 可以使用system功能,直接从机器中获得的价值,如果你运行的是Linux: $nanotime = system('date +%s%N'); 阅读全文
posted @ 2020-08-21 00:26 study_php_java_C++ 阅读(724) 评论(0) 推荐(0) 编辑
摘要: 先说一下,生成rsa 私钥 公钥的方法,以ubuntu 为例sudo apt-get install openssl # 先装上这个库genrsa -out rsa_private_key.pem 1024 #生成1024长度的私钥, 支付宝的 rsa2 要求是 2048长度,这里可以修改一下rsa 阅读全文
posted @ 2020-08-17 18:04 study_php_java_C++ 阅读(10079) 评论(0) 推荐(0) 编辑
摘要: $num = 10.4567; //第一种:利用round()对浮点数进行四舍五入 echo round($num,2); //10.46 //第二种:利用sprintf格式化字符串 $format_num = sprintf("%.2f",$num); echo $format_num; //10 阅读全文
posted @ 2020-08-14 09:29 study_php_java_C++ 阅读(2768) 评论(0) 推荐(0) 编辑
摘要: 问题: 从git上面pull下来脚本文件,在Linux上面执行。执行chmod +x 后,如果再次有修改文件,git pull 的提示会终止。每次都要使用 git checkout -- <filename> 来强制覆盖文件,然后才能再次下拉文件 解决方法 进入项目文件夹,配置git 忽略文件权限 阅读全文
posted @ 2020-08-09 10:05 study_php_java_C++ 阅读(512) 评论(0) 推荐(0) 编辑
摘要: 使用TP6,因为需要跨域上传图片,一直不成功,网上搜了好久,方法都没解决跨域上传文件 比如下面的方式没成功 $this->app = $app; $this->request = $this->app->request; // 支持跨域请求的host数组['a.cn', 'b.cn'] $corsH 阅读全文
posted @ 2020-07-21 07:51 study_php_java_C++ 阅读(4188) 评论(1) 推荐(0) 编辑
摘要: 和TP5生成url方式有区别, 在控制器里 需要加上 ->build(), 如 url('index/arc/list')->build(); 如果是多域名还需要指定域名,如不想加域名可以 url('index/arc/list')->domain('')->build(); 在视图里,我的是多域名 阅读全文
posted @ 2020-07-19 23:27 study_php_java_C++ 阅读(4119) 评论(0) 推荐(0) 编辑
摘要: 在CentOS8.0中默认不再支持ntp软件包,时间同步将由chrony来实现,像我这种习惯了ntp同步时间的,一时难以去适应chrony。 本文将通过wlnmp提供的源,来安装ntp服务 添加wlnmp源 rpm -ivh http://mirrors.wlnmp.com/centos/wlnmp 阅读全文
posted @ 2020-07-10 16:34 study_php_java_C++ 阅读(6075) 评论(0) 推荐(1) 编辑
摘要: 显示最后更新时间是1970年... 还有感叹号,没法同步 解决办法: 管理员运行cmd命令: 输入“netsh int ip reset c: esetlog.txt”,按下回车键。 再次输入“netsh winsock reset”命令后按回车。 最好重启电脑即可 阅读全文
posted @ 2020-07-05 12:05 study_php_java_C++ 阅读(343) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 41 下一页