随笔分类 - php
摘要:多PHP版本只支持LNMP模式,LNMPA、LAMP模式下不支持!要使用多PHP先安装多PHP版本,在lnmp1.4源码(lnmp1.3的不行哦)目录下运行:./install.sh mphp 按提示选择要另外安装的PHP版本,不能多选,只能选一个,要安装多个需要安装完成后再运行前面的安装命令。已经
阅读全文
摘要:zb@zb-computer:/usr/local/nginx/conf/vhost$ ps -ef | grep php-fpmroot 10205 2359 0 15:07 ? 00:00:00 php-fpm: master process (/usr/local/php/etc/php-fp
阅读全文
摘要:public function Base64EncodeImage($ImageFile) { // 图片转化base64格式 , 图片需要在本地,有访问权限 , 相对于项目路径 if(file_exists($ImageFile) || is_file($ImageFile)){ $image_info = getimagesize($ImageFile); $image_data = frea
阅读全文
摘要:<pre>array(16) { ["appid"] => string(18) "xxxxxxxxxxxxxxxxxxx" ["bank_type"] => string(3) "CFT" ["c
阅读全文
摘要:date("Y-m-d H:i:s",strtotime("+1 month")) 下个月今天此时 $stime = strtotime('2019-11-11'); date("Y-m-d H:i:s",strtotime("+1 month",$stime)) 距离某日期开始,下个月该时间
阅读全文
摘要:在PHP中暂停代码执行一定时间,有两个函数可以实现,一个是sleep(),另一个是usleep(),它们参数都是一个整数值。sleep()是暂停多少秒,usleep()是暂停多少微秒。 注意:usleep()单位是微秒,1秒 = 1000毫秒 ,1毫秒 = 1000微秒,即1微秒等于百万分之一秒。
阅读全文
摘要:array(9) { [0]=> string(16) "CallbackDemo.php" [1]=> string(8) "Demo.php" [2]=> string(9) "README.md" [3]=> string(15) "UnionClient.php" [4]=> string(
阅读全文
摘要:$p = 'http://'; $p = '/'.preg_quote($p, '/').'/'; echo $p;/http\:\/\//
阅读全文
摘要:array_slice 分割数组, 效果相当于 substr 类似字符串操作
阅读全文
摘要:<?php class Car { private function __construct() { echo 'object create'; } private static $_object = null; public static function getInstance() { if (
阅读全文
摘要:function test3($i){ echo $i . '<br/>'; if ($i >= 0){ $func = __FUNCTION__; // 外面函数名称变了,不用跟着变 $func($i - 1); } echo $i . '<br/>'; } test3(3); 3 2 1 0 -1 -1 0 1 2 3
阅读全文
摘要:Array( [title] => 推荐 [code] => 1) array(3) { [1]=> string(6) "推荐" [3]=> array(2) { // 这里出现很诡异的结果 ["title"]=> string(7) "奇闻2" ["code"]=> int(2) } [4]=>
阅读全文
摘要:$User = D('User'); $User->query('select * from think_user where status=1'); $User->execute('update think_user set status=1 where id=1');
阅读全文
摘要:$_SERVER["SERVER_ADDR"] 当前运行脚本的服务器的ip地址
阅读全文
摘要:<pre>array(8) { [0] => int(3) [1] => int(3) [2] => int(3) [3] => int(3) [4] => int(2) [5] => int(2) [6] => int(2) [7] => int(2
阅读全文
摘要:banana [6] => banana [7] => banana [8] => banana [9] => banana [10] => banana ) Array ( [-2] => pear [0] => pear [1] => pear [2] => pear )
阅读全文
摘要:sprintf('%.2f',$a) //强大的格式化函数 //结果为字符串 //小数点位数不够,填充0
阅读全文
摘要:<pre>array(0) {}</pre> <pre>array(2) { [0] => int(2) [1] => int(3)}</pre>
阅读全文

浙公网安备 33010602011771号