上一页 1 ··· 13 14 15 16 17
摘要: 今天想测试下 like 'string%' 和 left() 的效率问题 想到了公司DBA大哥曾经用过的mysql 函数 sql_no_cache顺便说下测试结果。。因为目前mysql 是不支持函数索引的 所以 2是完胜的 1、select sql_no_cache * from test where left( goods_title, 11 ) = 'metersbonwe' 2、select sql_no_cache * from test where goods_title like 'metersbonwe%' 阅读全文
posted @ 2012-04-24 10:07 ﹏Sakura 阅读(2664) 评论(0) 推荐(0) 编辑
摘要: 唉 通宵上项目发现一个图片检测方法在本地很快 上到服务器上检测卡死。<?php $img_exists = get_headers($pic,1); if(!empty($img_exists) && $img_exists[0] =='HTTP/1.1 200 OK' && $img_exists['Content-Length']!=18771){ $model_show .= '<img src="'.$pic.'" width="438" /> 阅读全文
posted @ 2012-04-23 23:16 ﹏Sakura 阅读(1022) 评论(0) 推荐(0) 编辑
摘要: 1.echo和print的区别 PHP中echo和print的功能基本相同(输出),但是两者之间还是有细微差别的。echo输出后没有返回值,但print有返回值,当其执行失败时返回flase。因此可以作为一个普通函数来使用,例如执行下面的代码后变量$r的值将为1。 $r = print "Hello World"; 这意味着print可用在一些复杂的表达式中,而echo则不行。但是,因为echo语句不要求返回任何数值,所已在代码中echo语句的运行效率要略微快于print语句。 2.include与require的区别 include()与require()的功能也基本相同 阅读全文
posted @ 2012-04-22 21:32 ﹏Sakura 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 最近迷上了JS 没办法 搞WEB离不开这东西 ,所以如果哪位仁兄还说JS无用论 还请绕道 过开发积累的经验 加上书本上的知识 (也算是理论与实际相结合吧)总结此文 也算是自己学习阶段的一份总结吧 !希望给广大JS 爱爱好者一点帮助 废话不多说 JS 继承一般分为3种 今天先说第一种类式继承 首先来说JS 本事是没有类的概念的 。JS 的类实际就是function 对象 先上码<script>function Test(name){ this.name = name;}Test.prototype.fun = function(){alert(0)}testInc = new T.. 阅读全文
posted @ 2012-04-20 22:57 ﹏Sakura 阅读(647) 评论(0) 推荐(1) 编辑
摘要: 闲来无聊就测试了下 instanceof 和 typeof 都是用来判断一个JS 变量类型的。 不同的是 instanceof 的用法是<script>var test = function(){ };testInc = new test();alert(typeof(testInc)); //objectalert(testInc instanceof test); //true</script>正如测试结果一样 typeof 会返回一个基本数据类型 而 instanceof 一般是用来验证一个对象是否属于某类值得一提的是 大家可能一直认为 function 里的ar 阅读全文
posted @ 2012-04-17 23:52 ﹏Sakura 阅读(625) 评论(0) 推荐(0) 编辑
摘要: <script type=text/javascript src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" /></script> //google jqueryonclick="event.returnValue=false;" //禁用checkbox 火狐无效encodeURIComponent() JS中文URL编码 utf8function addFav(t) {document.write('<a href=" 阅读全文
posted @ 2012-04-16 13:08 ﹏Sakura 阅读(5416) 评论(0) 推荐(0) 编辑
摘要: 1、js 是使用for来遍历一个object的例如:<script>var obj = {p1:"aaa",p2:"bbb"};for(i in obj){ alert(obj[i]);}</script>需要注意:<script>var testobj = ["aa","bb","cc"];for(i in testobj){ //alert(i);}alert(i); //结果是2</script>在PHP 里面<?php$arr = a 阅读全文
posted @ 2012-04-15 20:09 ﹏Sakura 阅读(289) 评论(0) 推荐(0) 编辑
上一页 1 ··· 13 14 15 16 17