随笔分类 - php
摘要:多版本php,在php7.2的环境下安装composer 需设置.composer 文件夹权限,须到安装项目路径下安装 注意 设计到php,都是跟着php7.2的安装配置路径走的; 下载命令: curl sS https://getcomposer.org/installer | /usr/loca
阅读全文
摘要:realpath 返回绝对路径。 该函数删除所有符号连接(比如 '/./', '/../' 以及多余的 '/'),返回绝对路径名。 若失败,则返回 false。比如说文件不存在的话。
阅读全文
摘要:1.下载yaf扩展库源码安装包 官网下载页面:http://pecl.php.net/package/yaf 2.下载yaf扩展库源码安装包 wget -c http://pecl.php.net/get/yaf-3.0.7.tgz 3.解压yaf扩展yaf-3.0.6.tgz包 tar -xzvf yaf-3.0.6.tgz cd yaf-3.0.6 4.生成编译configure配置文件 su
阅读全文
摘要:多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)){ 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)) 距离某日期开始,下个月该时间
阅读全文
摘要:在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(
阅读全文
摘要:array_slice 分割数组, 效果相当于 substr 类似字符串操作
阅读全文
摘要:<?php class Car { private function __construct() { echo 'object create'; } private static $_object = null; public static function getInstance() { if (
阅读全文
摘要:Array( [title] => 推荐 [code] => 1) array(3) { [1]=> string(6) "推荐" [3]=> array(2) { // 这里出现很诡异的结果 ["title"]=> string(7) "奇闻2" ["code"]=> int(2) } [4]=>
阅读全文
摘要: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
阅读全文