PHP
关元
这个作者很懒,什么都没留下…
展开
-
LNMP(tp5)
安装php: sudo apt install php7.0-mbstring php7.0-gd php7.0-mbstring php7.0-mysql 安装MariaDB: $ sudo apt install mariadb-server 启动MariaDB服务: $ sudo systemctl restart mysql $ sudo systemctl enable my...原创 2018-06-11 14:39:18 · 588 阅读 · 0 评论 -
emoji
emoji的存储需要使用utf8mp4,不然就要转码(base64加密),emoji的取出要修改连接数据库的配置文件,修改charset为utf8mb4原创 2018-09-27 16:39:03 · 228 阅读 · 0 评论 -
时间日期函数库
/** * 转换为时间戳 * @param type $source 日期 * @param string $condition * @param type $now * @return type */function to_timestamp($source, $condition = "", $now = null){ if (is_numeric($source)...原创 2018-09-08 13:43:23 · 202 阅读 · 0 评论 -
php排序算法
/** * 简单式快排,空间复杂度更高 * @param type $arr * @return type */ public function quickSortSimple($arr) { $length = count($arr); if ($length == 1 || $length == 0...原创 2018-08-20 11:36:15 · 124 阅读 · 0 评论 -
php数组函数库
/** * 取数组指定个数的键和值组成新数组 * ,先排序可以取排名 * @param array $source_arr * @param type $number * @return array */function array_rank_num(Array $source_arr, $number){ $temp_arr = $source_arr; $ne...原创 2018-08-15 16:02:03 · 184 阅读 · 0 评论 -
php7构造函数异常
Deprecated:Methods with the same name as their class will not be constructors in a future version of PHP看到这个报错之后,只要把和类名相同的函数改成__construst就可以了. php7之后构造函数只能是__construst...原创 2018-07-14 15:54:25 · 989 阅读 · 0 评论 -
TP 接口抛异常
第一步,改配置更改相应模块下(全局改application)config下的app.php,把改成自己的处理异常类// 异常处理handle类 留空使用 \think\exception\Handle'exception_handle' => '\app\lib\exception\MyExceptionHandler',第二步,重写父类方法class Excep...原创 2018-07-09 10:59:11 · 636 阅读 · 0 评论 -
I_最后沟通
没有问题不适合如果你说,我没有问题要问,那就会显得你不够积极,很随意。面试官对你的问题也是目的明确的,通过的你的回问,他想进一步了解你关心和在意的方面。另外如果你问题问得好的话,还会给你的面试加分。问题的讲究性拒绝小格局问题,例如:几点上班几点下班?有没有加班费?这种问题,显然格局太小,如果非要问,可以讲究下语境,例如:“我比较遵循时间,喜欢按时上下班,请问贵公司在上下班时间上有没有什...转载 2018-06-30 22:19:01 · 151 阅读 · 0 评论 -
I_6月3号更新
1、PHP语言的一大优势是跨平台,什么是跨平台?PHP的运行环境最优搭配为Apache+MySQL+PHP,此运行环境可以在不同操作系统(例如windows、Linux等)上配置,不受操作系统的限制,所以叫跨平台2、WEB开发中数据提交方式有几种?有什么区别?百度使用哪种方式?Get与post两种方式区别:1. Get从服务器获取数据,post向服务器传送数据2. Get传值在u...转载 2018-06-30 22:18:05 · 189 阅读 · 0 评论 -
I_PHP 安全经验
1 MySQL数据库作发布系统的存储,一天五万条以上的增量,预计运维三年,怎么优化?a. 设计良好的数据库结构,允许部分数据冗余,尽量避免join查询,提高效率。 b. 选择合适的表字段数据类型和存储引擎,适当的添加索引。 c. mysql库主从读写分离。 d. 找规律分表,减少单表中的数据量提高查询速度。 e。添加缓存机制,比如memcached,apc等。 f. 不经常改动的页面...转载 2018-06-30 22:16:10 · 115 阅读 · 0 评论 -
TP5 model 模型事件
快捷方法 beforeInsert afterInsert beforeUpdate afterUpdate beforeWrite afterWrite beforeDelete afterDelete beforeRestore afterRestore通常用法是写到init函数去绑定事件 protected static function init() ...原创 2018-06-14 17:58:35 · 1720 阅读 · 0 评论 -
TP5 Model类的数据完成
主要是用$insert ,$auto ,$update覆盖父类变量,然后就会在调用insert或update的时候调用赋值函数 $auto是指所有情况,即 insert和update都会调用 protected $insert = ['c_datetime', 'member_id', 'state' => 0]; protected $auto = ['u_date...原创 2018-06-14 17:47:52 · 907 阅读 · 0 评论 -
输出对象,结果显示数组
试试调用这个对象的函数,如果函数可以正常运行 看输出函数原创 2018-06-14 09:24:33 · 436 阅读 · 0 评论 -
PHP的五种模式
apache : apache isapi(Internet Server Application Program Interface):iis FAST-CGI (long-live CGI) :nginx cli(Command Line Interface): 命令行 **CGI**Common Gateway Interface)):网关在PHP5.3以后,PHP不再有IS...原创 2018-06-12 17:57:14 · 137 阅读 · 0 评论