摘要: 一天一个jQueryUI组件,今天折腾resizable。resizable是让对象拥有可调整大小的属性,类似于windows文件夹一样可以通过拖动边或者角来调整文件夹的大小。要使用resizable,需要应用一下文件:XML/HTML代码<scripttype="text/javascript"src="js/jquery-1.3.2.min.js"></script><scripttype="text/javascript"src="development-bundle/ui/ui.core 阅读全文
posted @ 2012-12-07 14:21 睡着的糖葫芦 阅读(12355) 评论(2) 推荐(2) 编辑
摘要: 原文link:http://bbs.lampbrother.net/read-htm-tid-117975.htmlfunction test($n){ echo $n." "; if($n>0){ test($n-1); }else{ echo "<-->"; } echo $n." ";}test(10);大家首先思考一下,这个例子最终的输出结果是什么?好,我们来看一下本函数输出的结果:10 9 8 7 6 5 4 3 2 1 0 <--> 0 1 2 3 ... 阅读全文
posted @ 2012-12-07 11:34 睡着的糖葫芦 阅读(184) 评论(0) 推荐(0) 编辑
摘要: //循环创建目录//$dirs为一个数组 元素为路径//$dirs=array(//'Text/',//'Tpl/'//)/*foreach($dirs as $dir){ //$dir为路劲不包含文件名 if(is_dir($dir)) mk_dir($dir,0777);}*///方法2(thinkphp)// 递归创建目录/*function mk_dir($dir, $mode = 0777) { //只创建1级目录 $dir='./a'; if (is_dir($dir) || @mkdir($dir, $mode)) return t 阅读全文
posted @ 2012-12-07 10:54 睡着的糖葫芦 阅读(459) 评论(0) 推荐(0) 编辑
摘要: //先讲解__call方法的基础使用//__call魔术方法,当调用一个类的方法,此方法不存在 //就会执行__call方法 class Computer { public function _run() { echo '运行'; } //采用__call()方法屏蔽调用 /... 阅读全文
posted @ 2012-12-07 10:02 睡着的糖葫芦 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 1 //有一些函数,名字未知 2 //名字在运行状态时,才知道 3 4 //例如a(),b(),c()调用哪一个 5 // ->index(),reg()?又调用哪一个 6 7 function t(){ 8 echo 'hello'; 9 }10 11 function s(){12 echo 'world';13 }14 15 $a='t';16 //$a();17 18 //在php中,变量名可以是动态19 //如20 $str='name';21 $name='lisi';22 //echo $$st 阅读全文
posted @ 2012-12-07 09:51 睡着的糖葫芦 阅读(449) 评论(0) 推荐(0) 编辑
摘要: function redirect($url,$time=0,$msg=''){ //多行URL地址支持 //去除多行url之间的换行 //范例1,看看不用str_replace和用的区别 $url=str_replace(array("\n","\r"),'',$url); if(empty($msg)) $msg = "系统将在{$time}秒之后自动跳转到{$url}!"; //如果报头未发送 if(!headers_sent()){ if(0===$time){ header("Loc 阅读全文
posted @ 2012-12-07 09:32 睡着的糖葫芦 阅读(257) 评论(0) 推荐(0) 编辑