摘要: $line) { echo $line; //逐行输出大文件 } /*-----------------------------------------------------------------------*/ function xrange($start, $end, $step = 1) { for ($i = $start; $i query($sql);... 阅读全文
posted @ 2017-06-21 19:55 雨落知音 阅读(257) 评论(0) 推荐(0) 编辑
摘要: method_exists判断方法是否存在 call_user_func 动态传入函数方法名 register_shutdown_function当PHP脚本发生致命错误时调用的方法 trigger_error() 函数创建用户级别的错误消息。 __set __get __call __callst 阅读全文
posted @ 2017-06-21 19:53 雨落知音 阅读(483) 评论(0) 推荐(0) 编辑
摘要: HTML代码 PHP代码 阅读全文
posted @ 2017-06-21 19:49 雨落知音 阅读(201) 评论(0) 推荐(0) 编辑
摘要: <?php /** * PHP-HTTP断点续传实现 * @param string $path: 文件所在路径 * @param string $file: 文件名 * @return void */ function download($path,$file) { $real = $path.'/'.$file; if(!file_exists($real)) { ... 阅读全文
posted @ 2017-06-21 19:47 雨落知音 阅读(1072) 评论(0) 推荐(0) 编辑
摘要: 服务器防盗链 假设域名为www.localhost.com 1.apache配置httpd.conf 2.apache配置.htaccess 3.nginx设置/usr/local/nginx/conf/nginx.conf这个文件,将如下代码匹配在server{ }段里面即可 45.php设置 阅读全文
posted @ 2017-06-21 19:46 雨落知音 阅读(302) 评论(0) 推荐(0) 编辑
摘要: 今天面试遇到一个斐波那契数列的求法 1 1 2 3 5 8 13 ... 要求写出算法 阅读全文
posted @ 2017-06-21 19:00 雨落知音 阅读(3373) 评论(0) 推荐(1) 编辑
摘要: SQL注入 例:脚本逻辑 案例2:SELECT * FROM t WHERE a > 0 AND b IN(497 AND (SELECT * FROM (SELECT(SLEEP(20)))a) ); 案例3:SELECT * FROM t WHERE a=1 and b in (1234 ,(S 阅读全文
posted @ 2017-06-21 18:40 雨落知音 阅读(4647) 评论(0) 推荐(0) 编辑
摘要: 今天去面试,谈到一个话题,在负载均衡的服务器集群上如何共享session。 回来后去查了下。 业界对于这个问题的解决大体会用以下三种方式: 1. 将session存入专门的一个数据库 2. 将session存入专门的一台session服务器的磁盘里 3. 将session存入专门的一台session 阅读全文
posted @ 2017-06-21 18:05 雨落知音 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 1. 仅更新单个库 2. 不编辑composer.json的情况下安装库 3. 派生 http://www.phpcomposer.com/5-features-to-know-about-composer-php/ 后面还有两条不太理解就没有摘抄过来了 阅读全文
posted @ 2017-06-21 17:43 雨落知音 阅读(133) 评论(0) 推荐(0) 编辑
摘要: <?php class C { //三私一公 protected static $_instance = null; protected function __construct() //protected方便继承 ,privated无法继承 { throw new Exception("禁止实例化"); } protected f... 阅读全文
posted @ 2017-06-21 17:27 雨落知音 阅读(182) 评论(0) 推荐(0) 编辑
摘要: mysql> show variables like '%slow_query_log%';+ + +| Variable_name | Value |+ + +| slow_query_log | OFF || slow_query_log_file | ZhiBingLiu-slow.log | 阅读全文
posted @ 2017-06-21 17:10 雨落知音 阅读(159) 评论(0) 推荐(0) 编辑