摘要: 1 // 防止json中文转码2 function jsonEncodeWithCN($data) {3 return preg_replace("/\\\u([0-9a-f]{4})/ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '$1'))", json_encode($data));4 }5 6 $arr = array('a'=>'测试', b=>'hello');7 8 echo j 阅读全文
posted @ 2014-04-10 13:00 辰阳 阅读(621) 评论(2) 推荐(0) 编辑
摘要: 1 /** 2 * 获取GET提交的参数 3 * @return JSON格式 4 * @author Terry 5 */ 6 function getArgs(){ 7 var args = {}; 8 var match = null; 9 var search = decodeURIComponent(location.search.substring(1));10 var reg = /(?:([^&]+)=([^&]+))/g;11 while((match = reg.exec(search))!==null){12 ... 阅读全文
posted @ 2014-02-24 15:44 辰阳 阅读(2136) 评论(0) 推荐(0) 编辑
摘要: Zen Coding插件就不介绍了。众所周知,安装了插件以后,输入$符号会被自动解析为相应的数字1、2、3...作为一名PHP程序员,想要通过其定义一些自己常用的代码。却发现展开以后悲剧的发现$符号全变成了数字。下面教你解决方法: 阅读全文
posted @ 2013-11-17 10:04 辰阳 阅读(372) 评论(0) 推荐(0) 编辑