随笔分类 -  php

摘要:"> "> "> 阅读全文

posted @ 2007-11-25 10:54 古代 阅读(945) 评论(0) 推荐(0) 编辑

摘要:function date2( $time , $format='H:i:s' ){ $h = intval($time/3600); $minSeconds = $time%3600; $i = intval($minSeconds/60); $s = $minSeconds%60; if($h<10)$h="0".$h; if($i<10)$i="0".$i; if($s<10... 阅读全文

posted @ 2007-11-23 13:07 古代 阅读(406) 评论(0) 推荐(0) 编辑

摘要:curl的cookie怎么使用?新手都很头疼的,curl的参数太多了,其中cookie部分就涉及了4个。 当然了,手册上明白写的curl的cookie是3个,但是嘛,不是还有个header的参数嘛,里面可以包含cookie. 七巧游戏网(http://7game.net.cn/)的采集是基于curl库的。 curl非常的好用。最主要的是要熟悉curl_setopt的用法。 curl_setopt ... 阅读全文

posted @ 2007-11-19 11:50 古代 阅读(5315) 评论(0) 推荐(0) 编辑

摘要:/*** 删除本地拷贝里的所有SVN版本信息* 2007-10-29* bailing* wubl.9991.com@gmail.com*/require_once("iecho.php");require_once('F:\web\mobile.duote.com\api\batchFile.php');$bat = "";$batDel = "";$fl = new batchFile;$fl... 阅读全文

posted @ 2007-10-29 16:27 古代 阅读(806) 评论(3) 推荐(0) 编辑

摘要:apache会缓存一点字节,直到一个缓冲区满才会开始发送到客户端缓冲大概是512个字节吧。 put5k(); //输出5000个字节function put5k(){ echo "";} 阅读全文

posted @ 2007-08-13 11:58 古代 阅读(297) 评论(0) 推荐(0) 编辑

摘要:usort( $rows , "arsortByDate" );function arsortByDate( $a , $b ){ //return ($a['id']-$b['id']); return ($b['addTime']-$a['addTime']);} 阅读全文

posted @ 2007-08-13 11:51 古代 阅读(255) 评论(0) 推荐(0) 编辑

摘要:table分列 $contentTpl =id.".html target=_blank>thumbImg."' alt='".\$row->sName. \$row->sEdition.\$row->intro."' width=175 height=131 />id.".html' target=_blank>".\$row->sName."imgInfo."' >游戏预览";EOD;ech... 阅读全文

posted @ 2007-08-13 11:49 古代 阅读(372) 评论(0) 推荐(0) 编辑

摘要:1  2  3  4  5  6  7  8  9 10 TTTTTTTT 11 12 13 TTTTTTTT 14  15  16  17  18  19  20  21  22  23  24  25  26  27  28 ... 阅读全文

posted @ 2007-08-09 11:21 古代 阅读(1820) 评论(0) 推荐(0) 编辑

摘要:function ArrayToPhp( $arrayName , $array ){ $str = ""; return $str;}function ArrayToString($obj){ if(empty($obj)) return "array()"; $objType=gettype($obj); if ($objType=='array') { ... 阅读全文

posted @ 2007-08-01 15:23 古代 阅读(297) 评论(2) 推荐(0) 编辑

摘要:set_time_limit(3600);require_once("iecho.php");require_once( "API/batchFile.php");$fl = new batchFile();$fl->extname ="*"; //the file type need to be operated ,format is [;php;html;]$fl->deepLimit = 0... 阅读全文

posted @ 2007-07-22 21:34 古代 阅读(219) 评论(0) 推荐(0) 编辑

摘要:因为密码里包含了$,而又用双引号将密码括起来,$被解释为了变量,于是就连不上了。 阅读全文

posted @ 2007-07-10 11:08 古代 阅读(275) 评论(0) 推荐(0) 编辑

摘要:$file ){ $rows[$file]['cnt']++; $rows[$file]['size']=$matches[2][$key];}arsort($rows);$i=0;$t = 0;foreach( $rows as $file=>$row ){ $size = $row['cnt']*$row['size']; $r[$file] = getMbps($si... 阅读全文

posted @ 2007-06-26 17:18 古代 阅读(463) 评论(0) 推荐(0) 编辑

摘要:function getMbps($bytes){$m = 15; //minutes return 8*($bytes/(1024*1024))/($m*60) . "Mbps"; } 阅读全文

posted @ 2007-06-25 09:53 古代 阅读(186) 评论(0) 推荐(0) 编辑

摘要://is_writeable 函数不准确function mkdir_p($target){ $parentDir = dirname($target); if( $parentDir==$target ){ echo "创建目录失败 "; return false; } //$parentDir = $target if (file_exists($target)) { if... 阅读全文

posted @ 2007-06-21 14:29 古代 阅读(338) 评论(0) 推荐(0) 编辑

摘要://用户注册写入数据库$userPass = "test";$salt = "$1$123456789$";$crypted = crypt( $userPass , $salt ); //加密过后 $1$123456789$oEitTZYQtRHfNGmsFvTBA/$passToDb = substr( $crypted , strlen($salt) );//将passToDb写入数... 阅读全文

posted @ 2007-06-20 13:30 古代 阅读(702) 评论(0) 推荐(0) 编辑

摘要:/* * 这个函数用来将数组或对象重新组合成一个字符串。用在php代码中* bug无法修补?slashes的问题* @author bailing*/function ArrayToString($obj){ //prt($obj); $objType=gettype($obj); if ($objType=='array') { $objstring = "arr... 阅读全文

posted @ 2007-06-11 15:53 古代 阅读(538) 评论(0) 推荐(0) 编辑

摘要:这个更慢,代码要简单些 $down=软件详细页面列表页EOD;$time1 = getmicrotime();$pt = new parseTpl;$n=1;for ($i=0;$iparse($down);}$time1End = getmicrotime();echo ($time1End-$time1)."\n";class parseTpl{ function parse($data... 阅读全文

posted @ 2007-06-05 15:03 古代 阅读(240) 评论(1) 推荐(0) 编辑

摘要:internet选项-安全-自定义级别-其他 这里面有浏览器的各个安全设置,比如框架,跨域...,其中的 "允许用户通过脚本进行粘贴",这个选项必须为启用,setData才可以使用 阅读全文

posted @ 2007-05-30 16:17 古代 阅读(2085) 评论(0) 推荐(0) 编辑

摘要:$n=26;for ($i=0;$i";}a b c d e f g h i j k l m n o p q r s t u v w x y z 阅读全文

posted @ 2007-05-16 16:49 古代 阅读(243) 评论(0) 推荐(0) 编辑

摘要:Class M_time costs[] = $this->getmicrotime(); $this->msg[] = "start"; $this->print=$print; if($print) { echo "start:\t".$this->costs[0]."\n"; } } function b($msg='') { $prev = end($this->cost... 阅读全文

posted @ 2007-04-28 11:41 古代 阅读(322) 评论(0) 推荐(0) 编辑