摘要: 1.首先需要2个php文件 ReadHtmlCacheBehavior.php WriteHtmlCacheBehavior.php 2.将这两个文件放入 simplewind\cmf\behavior 修改文件的namespace , namespace cmf\behavior;3.添加配置到文 阅读全文
posted @ 2018-08-10 10:46 lsbaiwyl 阅读(1302) 评论(0) 推荐(0) 编辑
摘要: 11.// 调用Request对象的path方法12.{$Request.path}13.// 调用Request对象的module方法14.{$Request.module}15.// 调用Request对象的controller方法16.{$Request.controller}17.// 调用 阅读全文
posted @ 2018-06-25 08:49 lsbaiwyl 阅读(597) 评论(0) 推荐(0) 编辑
摘要: 在head头部添加如下代码即可 <!-- html5shiv.js和respond.js IE8支持HTML5元素和媒体查询 --><!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min. 阅读全文
posted @ 2018-05-26 16:01 lsbaiwyl 阅读(136) 评论(0) 推荐(0) 编辑
摘要: /** * 实现中文字串截取无乱码的方法 */function getSubstr($string, $start, $length) { if(mb_strlen($string,'utf-8')>$length){ $str = mb_substr($string, $start, $lengt 阅读全文
posted @ 2018-05-21 15:54 lsbaiwyl 阅读(172) 评论(0) 推荐(0) 编辑
摘要: /** * 检查手机号码格式 * @param $mobile 手机号码 */function check_mobile($mobile){ if(preg_match('/1[34578]\d{9}$/',$mobile)) return true; return false;} /** * 检查 阅读全文
posted @ 2018-05-21 15:53 lsbaiwyl 阅读(187) 评论(0) 推荐(0) 编辑
摘要: function timediff($begin_time,$end_time) { if($begin_time < $end_time){ $starttime = $begin_time; $endtime = $end_time; } else{ $starttime = $end_time 阅读全文
posted @ 2018-05-18 10:18 lsbaiwyl 阅读(261) 评论(0) 推荐(0) 编辑
摘要: function curlRequest($url, $data=array(), $method = 'GET'){ $method = strtoupper($method); $ch = curl_init(); curl_setopt($ch, CURLOPT_FAILONERROR, 1) 阅读全文
posted @ 2018-05-18 09:56 lsbaiwyl 阅读(217) 评论(0) 推荐(0) 编辑
摘要: /** * 取汉字的第一个字的首字母 * @param type $str * @return string|null */ function getFirstCharter($str){ if(empty($str)){return '';} $str=preg_replace('/·/', "" 阅读全文
posted @ 2018-05-18 09:47 lsbaiwyl 阅读(383) 评论(0) 推荐(0) 编辑
摘要: function createXmls($cars){ $xml = new DOMDocument(); $xml->formatOutput = TRUE; $xml->encoding = 'utf8'; $root = $xml->createElement('urlset'); if (c 阅读全文
posted @ 2018-05-17 15:57 lsbaiwyl 阅读(122) 评论(0) 推荐(0) 编辑
摘要: public function actionImport() { //post请求过来的 $fileName = $_FILES['file']['name']; $fileTmpName = $_FILES['file']['tmp_name']; //判断是否选择了上传的文件 if (empty 阅读全文
posted @ 2018-05-11 18:11 lsbaiwyl 阅读(1664) 评论(0) 推荐(0) 编辑