11 2019 档案

摘要:Mysql主从复制: 主从复制: 主机准备工作: 开启bin.Log 注意:server-id 是唯一的值 重启mysql:service mysql restart 查看是否开启成功: 查看当前状态: 重置: 从机配置: 主机(151)授权: 意思:允许从机IP通过这个账号密码访问master 查 阅读全文
posted @ 2019-11-19 16:31 离岸少年 阅读(415) 评论(0) 推荐(0) 编辑
摘要:Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ i 阅读全文
posted @ 2019-11-19 16:18 离岸少年 阅读(1043) 评论(0) 推荐(0) 编辑
摘要:mkdir -p /soft/redis cd /soft/redis 下载:wget http://download.redis.io/releases/redis-5.0.8.tar.gz 解压:tar -zxvf redis-5.0.8.tar.gz 进入redis目录:cd redis-5. 阅读全文
posted @ 2019-11-19 11:35 离岸少年 阅读(133) 评论(0) 推荐(0) 编辑
摘要:1.进入svn 版本库(如/www/svn) 2.创建svn 版本库svnadmin create edition 3.进入新建的版本库库目录cd edition 4.进入版本库配置目录cd conf 5.配置 访问权限vim authz添加一下内容: admin = lin,xue,huang[/ 阅读全文
posted @ 2019-11-19 11:12 离岸少年 阅读(627) 评论(0) 推荐(0) 编辑
摘要:php常用函数归纳: /** * 截取指定长度的字符 * @param type $string 内容 * @param type $start 开始 * @param type $length 长度 * @return type */ function ds_substing($string, $ 阅读全文
posted @ 2019-11-18 17:50 离岸少年 阅读(178) 评论(0) 推荐(0) 编辑
摘要:移除微信昵称中的emoji字符: /** * 移除微信昵称中的emoji字符 * @param type $nickname * @return type */ function removeEmoji($nickname) { $clean_text = ""; // Match Emoticon 阅读全文
posted @ 2019-11-18 17:45 离岸少年 阅读(893) 评论(0) 推荐(0) 编辑
摘要:php加密解密函数: /** * 加密函数 * * @param string $txt 需要加密的字符串 * @param string $key 密钥 * @return string 返回加密结果 */ function ds_encrypt($txt, $key = '') { if (em 阅读全文
posted @ 2019-11-18 17:43 离岸少年 阅读(144) 评论(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 离岸少年 阅读(157) 评论(0) 推荐(0) 编辑
摘要:正则基本语法: \s 空格\S 不为空格都行+ 至少一个(包括一次)(贪婪 加?取消贪婪) \w 任意一个字符\W 不满足于w [\u4E00-\u9FA5] 汉字.* 任意字符串\d 数字{4} 限定4个* 限定前面字符串(包括0次)? 非贪婪模式| 或[] 任意字符 [^] 非 [a-z]区间. 阅读全文
posted @ 2019-11-18 17:15 离岸少年 阅读(168) 评论(0) 推荐(0) 编辑
摘要:替换某字段的字符串: UPDATE article SET content = replace(content, '解决', '解放') WHERE ID<5000; 清空数据库,id也置空: truncate table `v_comment`; 阅读全文
posted @ 2019-11-18 17:13 离岸少年 阅读(98) 评论(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 离岸少年 阅读(151) 评论(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 离岸少年 阅读(173) 评论(0) 推荐(0) 编辑
摘要:安装:https://getcomposer.org/download/ { "require":{ // "厂商/类库":"版本号", "smarty/smarty":"3.1.31", } } 新增:composer install修改:composer update卸载:composer re 阅读全文
posted @ 2019-11-18 16:49 离岸少年 阅读(237) 评论(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 离岸少年 阅读(245) 评论(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 离岸少年 阅读(434) 评论(0) 推荐(0) 编辑
摘要:select id,mobile,realname as name,weixin as message_note,address_des as address,create_time,cateid from v1_user UNION ALL select id,mobile,name,messag 阅读全文
posted @ 2019-11-07 17:08 离岸少年 阅读(7761) 评论(0) 推荐(0) 编辑
摘要:/* * 关联数组根据某个字段的值进行排序 * $array 数组 * $key 键值 * $order 排序 * */public function arr_sort($array,$key,$order="desc") { $arr_nums = $arr = array(); foreach 阅读全文
posted @ 2019-11-05 13:08 离岸少年 阅读(450) 评论(0) 推荐(0) 编辑
摘要:/* * 关联数组根据某个字段去重 * */ public function array_unset_tt($arr,$key='mobile'){ //建立一个目标数组 $res = array(); foreach ($arr as $value) { //查看有没有重复项 if(isset($ 阅读全文
posted @ 2019-11-05 13:06 离岸少年 阅读(307) 评论(0) 推荐(0) 编辑

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示