2014年7月31日
摘要: 标题 内容 阅读全文
posted @ 2014-07-31 18:59 whlives 阅读(277) 评论(0) 推荐(0) 编辑
摘要: 一、unix时间戳转普通时间:var unixtime=1358932051;var unixTimestamp = new Date(unixtime* 1000); commonTime = unixTimestamp.toLocaleString();alert("普通时间为:"+common... 阅读全文
posted @ 2014-07-31 17:36 whlives 阅读(1537) 评论(0) 推荐(0) 编辑
摘要: 插件网址http://wscratchpad.websanova.com/ 阅读全文
posted @ 2014-07-31 17:31 whlives 阅读(241) 评论(0) 推荐(0) 编辑
摘要: array_merge()函数把两个或多个数组合并为一个数组。如果键名有重复,该键的键值为最后一个键名对应的值(后面的覆盖前面的)。如果数组是数字索引的,则键名会以连续方式重新索引。注释:如果仅仅向 array_merge()函数输入了一个数组,且键名是整数,则该函数将返回带有整数键名的新数组,其键... 阅读全文
posted @ 2014-07-31 17:29 whlives 阅读(390) 评论(0) 推荐(0) 编辑
摘要: userAgent信息可以由navigator.userAgent拿到。例子:如果想来判断其中内容,可以用navigator.userAgent.match()或navigator.userAgent.indexOf()来判断前者一般是用来判断手机客户端,例如navigator.userAgent.... 阅读全文
posted @ 2014-07-31 17:28 whlives 阅读(21103) 评论(0) 推荐(0) 编辑
摘要: php通过$_SERVER['HTTP_USER_AGENT']获取浏览器useAgent 阅读全文
posted @ 2014-07-31 17:24 whlives 阅读(784) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-07-31 17:23 whlives 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 对于排查问题找出性能瓶颈来说,最容易发现并解决的问题就是MYSQL的慢查询以及没有得用索引的查询。=========================================================方法一:这个方法我正在用,呵呵,比较喜欢这种即时性的。Mysql5.0以上的版本可以支持... 阅读全文
posted @ 2014-07-31 17:18 whlives 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 代码下载 阅读全文
posted @ 2014-07-31 17:15 whlives 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 给你的div命名id=“abc”,js中用下面的语句就能获取到js的宽度并赋值给aa=document.all.abc.offsetWidth;然后通过alert(a);就能弹出这个值来了。 阅读全文
posted @ 2014-07-31 17:11 whlives 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 大家好,又到了随机文章的时间,请使用手机打开演示站点,然后像摇妹子一样摇晃手机,你会发现非常牛逼的事情,炫酷吧。该功能已经集成在Oconnor1.8中。本文主要讲解这货的原理。首先需要下载shake.js,shake.js github地址,我们只需要里面的shake.js,然后引入。添加“摇一摇”... 阅读全文
posted @ 2014-07-31 17:10 whlives 阅读(2805) 评论(0) 推荐(0) 编辑
摘要: 在使用Validform v5.3.2时(http://validform.rjboy.cn/)问题:可以为空,但不为空时需要按照指定格式验证数据查看文档:5.2.1版本之后,datatype支持:1、直接绑定正则:如可用这样写datatype="/\w{3,6}/i",要求是3到6位的字母,不区分... 阅读全文
posted @ 2014-07-31 17:08 whlives 阅读(278) 评论(0) 推荐(0) 编辑
摘要: 代码下载 阅读全文
posted @ 2014-07-31 16:10 whlives 阅读(157) 评论(0) 推荐(0) 编辑
摘要: mysql查询时间戳和日期的转换在数据库的使用中,经常需要按指定日期来查询记录,以便于统计,而在数据库中,有很多存储的是时间戳,也有的直接存日期,查询的时候可能不是那么好弄.mysql提供了两个函数: from_unixtime(time_stamp) -> 将时间戳转换为日期 u... 阅读全文
posted @ 2014-07-31 16:06 whlives 阅读(174) 评论(0) 推荐(0) 编辑
摘要: php json 解析有stdClass Objectmixedjson_decode(string$json[,bool$assoc= false[,int$depth= 512[,int$options= 0]]] )json待解码的jsonstring格式的字符串。This function ... 阅读全文
posted @ 2014-07-31 16:05 whlives 阅读(1263) 评论(0) 推荐(0) 编辑
摘要: 全选 …… 阅读全文
posted @ 2014-07-31 16:04 whlives 阅读(193) 评论(0) 推荐(0) 编辑
摘要: SimpleXML是PHP5后提供的一套简单易用的xml工具集,可以把xml转换成方便处理的对象,也可以组织生成xml数据。不过它不适用于包含namespace的xml,而且要保证xml格式完整(well-formed)。它提供了三个方法:simplexml_import_dom、simplexml... 阅读全文
posted @ 2014-07-31 16:03 whlives 阅读(308) 评论(0) 推荐(0) 编辑
摘要: .自定义字符串:你可以手动的编写子句:$where="name='Joe' AND status='boss' OR status='active'";$this->db->where($where);不知道大家去验证过没,我测试的时候蛋疼的发现它生成的SQL语句居然是:SELECT * FROM ... 阅读全文
posted @ 2014-07-31 16:03 whlives 阅读(459) 评论(0) 推荐(0) 编辑
摘要: preg_match_all—执行一个全局正则表达式匹配int preg_match_all ( string pattern, string subject, array matches [, int flags] )在 subject 中搜索所有与 pattern 给出的正则表达式匹配的内容并将... 阅读全文
posted @ 2014-07-31 16:01 whlives 阅读(625) 评论(0) 推荐(0) 编辑
摘要: js页面$.ajax({ type: “POST”, dataType: ‘json’, url: “add_vote.php”, data: “touid=”+uid+”&tousername=”+username, success: function(msg){ //js... 阅读全文
posted @ 2014-07-31 16:00 whlives 阅读(1062) 评论(0) 推荐(0) 编辑