摘要: www.abc.com/tag-xxx.html增加伪静态规则RewriteCond %{QUERY_STRING} ^(.*)$ RewriteRule ^tag-(.+)\.html$ /home/index/tag/?&tag=$1&%1 阅读全文
posted @ 2014-05-02 17:01 JasonBao 阅读(134) 评论(0) 推荐(0) 编辑
摘要: $list = array('a','b','c','d');foreach ($list as $key => $value) { if($key == 0){ print_r('第一个'); } if($key == count($list)-1){ print_r('最后一个'); }}不知道效率如何? 留存$list = array('a', 'b', 'c','d');foreach($list as $k=>$v 阅读全文
posted @ 2014-02-28 17:48 JasonBao 阅读(516) 评论(0) 推荐(0) 编辑
摘要: /* *函数说名 $str 传入汉字 * $charset 编码 * $ishead 返回首字母 */function GetPinyin($str,$charset="utf-8",$ishead = 0) { $restr = ''; $str = trim($str); if($charset=="utf-8"){ $str=iconv("utf-8","gb2312",$str); } $slen = strlen($str); $pinyins=array(); if ($slen 0x8 阅读全文
posted @ 2014-01-01 23:13 JasonBao 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1 function p($array){2 dump($array,1,'',0);3 die();4 } 阅读全文
posted @ 2014-01-01 23:12 JasonBao 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 1 function curl_post($url,$post_data){ 2 if(empty($url) || !is_array($post_data)){ 3 return false; 4 } 5 $ch = curl_init(); 6 curl_setopt($ch, CURLOPT_POST, 1); 7 curl_setopt($ch, CURLOPT_URL,$url); 8 curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); 9 ob_start(... 阅读全文
posted @ 2014-01-01 23:07 JasonBao 阅读(260) 评论(0) 推荐(0) 编辑