PHP
walle_lx
生活,也是一种享受!
展开
-
php数据加密解密
/** * 数据加密 / 解密 * @param $string: 明文 或 密文 * @param $operation:DECODE表示解密,其它表示加密 * @param $key: 密匙 * @param $expiry:密文有效期 * $str = '3412eafrmlcjS8g75DgHXRlehynzjp0Yw40fPYCl'; * $key = 'walle'; *原创 2016-02-17 09:08:02 · 476 阅读 · 0 评论 -
php 自动加载类函数spl_autoload_register()
php手册已经建议使用该函数spl_autoload_register(),而不再建议使用魔术方法__autoload(),这里也只做spl_autoload_register()解释。文档中描述的是spl_autoload_register()可以进行多个解释,而__atuoload()只是一个。 If there must be multiple autoload functio原创 2016-02-18 09:45:20 · 671 阅读 · 0 评论 -
php常用正则表达式
1. 平时做网站经常要用正则表达式,下面是一些讲解和例子,仅供大家参考和修改使用: 2. "^\d+$" //非负整数(正整数 + 0) 3. "^[0-9]*[1-9][0-9]*$" //正整数 4. "^((-\d+)|(0+))$" //非正整数(负整数 + 0) 5. "^-[0-9]*[1-9][0-9]*$" //负整数 6.转载 2016-02-18 16:04:20 · 244 阅读 · 0 评论 -
经典排序算法 - 冒泡排序Bubble sort
经典排序算法 - 冒泡排序Bubble sort原理是临近的数字两两进行比较,按照从小到大或者从大到小的顺序进行交换,这样一趟过去后,最大或最小的数字被交换到了最后一位,然后再从头开始进行两两比较交换,直到倒数第二位时结束,其余类似看例子例子为从小到大排序,原始待排序数组| 6 | 2 | 4 | 1 | 5 | 9 |第一趟排序(外循环)转载 2016-02-19 15:01:42 · 287 阅读 · 0 评论 -
分享一个php时间段切分为指定段的函数
/** * 把指定时间段切份 - N份 * ----------------------------------- * @param string $start 开始时间 * @param string $end 结束时间 * @param int $nums 切分数目 * @param boolean 是否格式化 * @return array 时间段数组 */原创 2016-07-18 20:09:55 · 2997 阅读 · 0 评论 -
数据库分卷备份 thinkphp3.2版
数据库分卷备份thinkphp3.2版摘自thinkcmf,功能经修复和部分修改控制器代码<?php// +----------------------------------------------------------------------// | TEA [ The customer with the product, we won't change any day. ]// +原创 2016-02-16 17:29:21 · 1766 阅读 · 0 评论