会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
lsbaiwyl
博客园
首页
新随笔
联系
管理
订阅
2018年8月10日
thinkcmf的基于tp5行为扩展的静态缓存
摘要: 1.首先需要2个php文件 ReadHtmlCacheBehavior.php WriteHtmlCacheBehavior.php 2.将这两个文件放入 simplewind\cmf\behavior 修改文件的namespace , namespace cmf\behavior;3.添加配置到文
阅读全文
posted @ 2018-08-10 10:46 lsbaiwyl
阅读(1348)
评论(0)
推荐(0)
2018年6月25日
thinkphp模板中获取方法名和控制器名
摘要: 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
阅读(687)
评论(0)
推荐(0)
2018年5月26日
让IE系列支持HTML5的html5shiv.js和respond.min.js
摘要: 在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
阅读(145)
评论(0)
推荐(0)
2018年5月21日
实现中文字串截取无乱码的方法
摘要: /** * 实现中文字串截取无乱码的方法 */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
阅读(179)
评论(0)
推荐(0)
php 检查邮箱 和手机号
摘要: /** * 检查手机号码格式 * @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
阅读(198)
评论(0)
推荐(0)
2018年5月18日
实现两个unix时间戳的差,并返回两个时间戳相差的天、小时、分、秒,精确到秒
摘要: 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
阅读(271)
评论(0)
推荐(0)
curl请求方法函数
摘要: 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
阅读(225)
评论(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
阅读(412)
评论(0)
推荐(0)
2018年5月17日
createXmls
摘要: 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
阅读(128)
评论(0)
推荐(0)
2018年5月11日
php解析csv文件
摘要: public function actionImport() { //post请求过来的 $fileName = $_FILES['file']['name']; $fileTmpName = $_FILES['file']['tmp_name']; //判断是否选择了上传的文件 if (empty
阅读全文
posted @ 2018-05-11 18:11 lsbaiwyl
阅读(1681)
评论(0)
推荐(0)
下一页
公告