摘要: php常用函数归纳: /** * 截取指定长度的字符 * @param type $string 内容 * @param type $start 开始 * @param type $length 长度 * @return type */ function ds_substing($string, $ 阅读全文
posted @ 2019-11-18 17:50 离岸少年 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 移除微信昵称中的emoji字符: /** * 移除微信昵称中的emoji字符 * @param type $nickname * @return type */ function removeEmoji($nickname) { $clean_text = ""; // Match Emoticon 阅读全文
posted @ 2019-11-18 17:45 离岸少年 阅读(880) 评论(0) 推荐(0) 编辑
摘要: php加密解密函数: /** * 加密函数 * * @param string $txt 需要加密的字符串 * @param string $key 密钥 * @return string 返回加密结果 */ function ds_encrypt($txt, $key = '') { if (em 阅读全文
posted @ 2019-11-18 17:43 离岸少年 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 常用正则: /** * 手机号码正则 * * @return string */ public static function mobile() { // return '/^[1][3456789][0-9]{9}$/'; return '/^(0|86|17951)?(13[0-9]|15[01 阅读全文
posted @ 2019-11-18 17:37 离岸少年 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 正则基本语法: \s 空格\S 不为空格都行+ 至少一个(包括一次)(贪婪 加?取消贪婪) \w 任意一个字符\W 不满足于w [\u4E00-\u9FA5] 汉字.* 任意字符串\d 数字{4} 限定4个* 限定前面字符串(包括0次)? 非贪婪模式| 或[] 任意字符 [^] 非 [a-z]区间. 阅读全文
posted @ 2019-11-18 17:15 离岸少年 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 替换某字段的字符串: UPDATE article SET content = replace(content, '解决', '解放') WHERE ID<5000; 清空数据库,id也置空: truncate table `v_comment`; 阅读全文
posted @ 2019-11-18 17:13 离岸少年 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 最严格身份证号码验证,支持15位和19世纪出生的人的身份证号码 # 计算身份证校验码,根据国家标准GB 11643-1999 function idcard_verify_number($idcard_base){ if(strlen($idcard_base)!=17){ return false 阅读全文
posted @ 2019-11-18 17:10 离岸少年 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1.重启httpd:service httpd restart2.查找目录下带有某个字符串的文件名: grep -r 'yicefin.com ' /www/vhost3.find / -name httpd.conf 全局 查找文件whereis 目录 4.查看 crontab -l编辑 cron 阅读全文
posted @ 2019-11-18 16:54 离岸少年 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 安装:https://getcomposer.org/download/ { "require":{ // "厂商/类库":"版本号", "smarty/smarty":"3.1.31", } } 新增:composer install修改:composer update卸载:composer re 阅读全文
posted @ 2019-11-18 16:49 离岸少年 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1.先用Fdisk -l 来查看当前状态下磁盘情况[root@linux1 ~]# fdisk -l2.用Fdisk /dev/hdb来进行分区操作。[root@linux1 ~]# fdisk /dev/vdbCommand (m for help): n //输入N表示新建一个分区Command 阅读全文
posted @ 2019-11-18 16:47 离岸少年 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 1.用正则 写出以139开头的手机号码:$str = '13812345678';$pattern = '/^139\d{8}$/';preg_match($pattern,$str,$macth);var_dump($macth); 2.用PHP方式对目录进行遍历 $dir = './test'; 阅读全文
posted @ 2019-11-18 14:49 离岸少年 阅读(430) 评论(0) 推荐(0) 编辑