摘要: /** * 验证身份证基本格式 * @param $idcard * @return bool */ public static function validateIdcard($idcard) { $City = array( '11', '12', '13', '14', '15', '21', 阅读全文
posted @ 2017-10-12 09:51 木辰于 阅读(707) 评论(0) 推荐(0) 编辑
摘要: http://idea.lanyus.com/ 阅读全文
posted @ 2017-10-12 09:50 木辰于 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 匹配字符串 {% if '皮肤' in '皮肤23213' %}1{% else %}2{% endif %} 时间格式转换 {{ time|date('Y-m-d H:i:s') }} 提取需要长度的字符串 {{ app.session.get(‘city_name’)[0:2] }}(如北京市提 阅读全文
posted @ 2017-10-12 09:46 木辰于 阅读(261) 评论(0) 推荐(0) 编辑
摘要: // $text=file_get_contents('http://huaban.com/'); // preg_match_all('/<img[^>]*>/i', $text, $match); // print_r($text); $keyword = "火影"; $keyword = ur 阅读全文
posted @ 2017-05-02 10:48 木辰于 阅读(624) 评论(0) 推荐(0) 编辑
摘要: 数组中文加数字 以数字排序 $a['4']='123区'; $a['5']='3区'; $a['6']='32区'; $a['7']='8区'; foreach ($a as $k => $v) { preg_match('/\d+/',$v,$arr); if(!empty($arr)){ $na 阅读全文
posted @ 2017-05-02 10:44 木辰于 阅读(356) 评论(0) 推荐(0) 编辑
摘要: function ismobile() { // 如果有HTTP_X_WAP_PROFILE则一定是移动设备 if (isset ($_SERVER['HTTP_X_WAP_PROFILE'])) return true; //此条摘自TPM智能切换模板引擎,适合TPM开发 if(isset ($_ 阅读全文
posted @ 2017-05-02 10:41 木辰于 阅读(163) 评论(0) 推荐(0) 编辑
摘要: C方法 直接读取参数 假设config.php里 return array( //'配置项'=>'配置值' 'URL_ROUTER_ON' => true, 'URL_MODEL' => '2', ); 则C(‘URL_MODEL’)为2 阅读全文
posted @ 2017-05-02 10:39 木辰于 阅读(153) 评论(0) 推荐(0) 编辑
摘要: public $fromUsername; public $time; public $toUsername; public $postObj; public $keyword; public function actionTestwx(){ $echoStr = Yii::$app->reques 阅读全文
posted @ 2017-05-02 10:34 木辰于 阅读(797) 评论(0) 推荐(0) 编辑
摘要: $openid = XXX; $template_id = "ti6LHLH0RqF9TGY5HVljwaXZL9_NjY_0M3NqHf1_4Qs"; if ($openid){ $sendData = [ "touser"=>$openid."", "template_id"=>$templat 阅读全文
posted @ 2017-05-02 10:32 木辰于 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 微信以openid获取用户信息 //先获取access_token $wxin_conf = Yii::$app->params['oauth_conf']['oauth_wx_in']; $url = "https://api.weixin.qq.com/cgi-bin/token?grant_t 阅读全文
posted @ 2017-05-02 10:30 木辰于 阅读(1151) 评论(0) 推荐(0) 编辑