2019-04-19PHP通过IP判断地区/** * 使用淘宝接口 判断ip,,,确定是否属于该地区 * @param $ip * @return bool */ function judgeIpByTaobao($ip) { $url = "http://ip.taobao.com/service/getIpInfo.php?ip=".$ip; $res = file_get_contents($
2019-04-16一段话中提取数量及单位$str = "牛肉肝蔬菜成犬粮15kg水电费发给都是范德萨"; // $match = '/[\d.\d]+|[kg|g]+/'; // 0 => // array (size=2) // 0 => string '15' (length=2) // 1 => string 'kg' (length=2) $match='/\d+\.{0,1}\d+[[:
2019-04-10thinkphp 字符截取函数msubstr()msubstr($str, $start=0, $length, $charset=”utf-8″, $suffix=true) $str:要截取的字符串 $start=0:开始位置,默认从0开始 $length:截取长度 $charset=”utf-8″:字符编码,默认UTF-8 $suffix=true:是否在截取后的字符后面显示省略号,默认true显示
2019-04-08shell学习 基础(2)linux权限用户权限 drwxr-xr-x root root -rw-r--r-- root root 解析: d 目录 - 文件 root 用户 root 用户组 rw- root所有者 r-- root所属组 r-- other其他用户 用户 查看用户 id user1 删除用户 userdel -r user1 添加用户 useradd user1 修改密码 p
2019-04-08shell学习 基础(1)#!/bin/bash #for.sh for i in a b c d do echo $i sleep done 设置权限 chmod a+x for.sh 不设去权限使用 bash ./for.sh 执行 tab自动补全 demo:设置网卡ip vi /etc/sysconfig/network-scripts/ifcfg-eth0 命令历史 hist
2019-03-18php获取 request payload中的数据if (isset($GLOBALS['HTTP_RAW_POST_DATA'])) { $userinfo1 = $GLOBALS['HTTP_RAW_POST_DATA']; } else { $userinfo1 = file_get_contents('php://input'); } $userinfo = object_to_array(json
2019-03-02微信分享 demoindex.html wx.config({ debug: false, appId: '', timestamp: '', nonceStr: '', signature: '', jsApiList: [ 'checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage' ] }); wx.ready