随笔分类 -  php

摘要:$dom = "2.dd.com.cn";$dom = "2.dd.net.cn";$dom = "2.dd.cn";$dom = "2.dd.com";$dom = "http://finance.qq.com/a/20091126/005836.htm";echo get_top_dom($dom);function get_top_dom($dom){$gendom_arr = array(... 阅读全文

posted @ 2009-11-26 17:15 古代 阅读(305) 评论(0) 推荐(0) 编辑

摘要:最近使用到汉字到拼音的转换,因此在众多搜索结果干扰项中探得此文。由于原文思路清晰,观点独特,故转载于此。本文实质上使用的是查表法,全文内容基本上是字典的获取方法注意:本文转自 http://blog.verycd.com/dash/cmd=showentry&eid=1677 ,以下为原文 细心的网友可能会发现,VeryCD的资源搜索是支持拼音的,不论你是直接输入拼音,还是输入同音字,我们... 阅读全文

posted @ 2009-11-04 13:26 古代 阅读(942) 评论(0) 推荐(0) 编辑

摘要:使用前确保开启了 mcrypt模块<?phpfunction idtag_des_decode($key,$encrypted){ $encrypted = base64_decode($encrypted); $td = mcrypt_module_open(MCRYPT_DES,'',MCRYPT_MODE_CBC,''); //使用MCRYPT_DES算法,cbc模式 $iv = mc... 阅读全文

posted @ 2009-07-10 11:18 古代 阅读(569) 评论(0) 推荐(0) 编辑

摘要:<?php//分别用不同机房的机器tracert故障机器的ip,得到的结果分别另存为文本。用这个程序,可以分析出不同的节点ip,从而得出故障路由节点何在//把tracert的结果贴到如下文件里去。$nvfile="f:/192.route";$data=file_get_contents ( $nvfile );$nvfile="f:/192-2.route";$data2=file_get... 阅读全文

posted @ 2009-07-02 11:29 古代 阅读(361) 评论(0) 推荐(0) 编辑

摘要:<?php$path = "/opt/case/img";scan( $path."/swfjpg4/" );scan( $path."/swfjpg3/" );scan( $path."/swfjpg2/" );scan( $path."/swfjpg/" );function scan($path){$arr = scandir($path);foreach( $arr as $img ... 阅读全文

posted @ 2009-05-06 02:58 古代 阅读(321) 评论(0) 推荐(0) 编辑

摘要:企业站程序 相对而言,这两个比较简单。 容易改。 阅读全文

posted @ 2009-04-22 18:02 古代 阅读(254) 评论(0) 推荐(0) 编辑

摘要:/* 由于PDO的sqlite取出的值,老是出现首字母小写变大写的问题,只好自己写一个类来替代。 prepare( 'SELECT * FROM file' );$stmt->execute();$rows = $stmt->fetchAll(5);*/ class PDO_sqlite{ function PDO_sqlite($dsn) { $this->connect( $d... 阅读全文

posted @ 2009-02-11 14:37 古代 阅读(658) 评论(0) 推荐(0) 编辑

摘要:代理服务器返回1.0的头,头中不含content-length. 这种情况真是让人觉得迷茫! HTTP/1.0 200 OKDate: Mon, 17 Nov 2008 06:16:37 GMTAccept-Ranges: bytesCache-Control: max-age=300Expires: Mon, 17 Nov 2008 06:21:37 GMTContent-Type: text/... 阅读全文

posted @ 2008-11-17 14:42 古代 阅读(211) 评论(1) 推荐(0) 编辑

摘要:用sqlite存储数据。 因为php都默认支持它了,所以,sqlite放心的用。 pdo,总之很顺利,程序好看多了,舒服多了。 阅读全文

posted @ 2008-10-27 13:40 古代 阅读(275) 评论(0) 推荐(0) 编辑

摘要:1 前言 什么是第三方cookie跨域的问题呢? 例如:在A网站中iframe B网站中的网页,如果IE浏览器的安全级别设置到中或更高的级别,那么B网站中的网页cookie就会出现不一致的问题或者受到限制不允许使用,如果把IE浏览器的安全级别设置到低那么第三方cookie就可以正常的使用但是cookie的一致性不能保证.这个问题原因就在于大多数cookie都是使用IE浏览器的cookie隐私策略... 阅读全文

posted @ 2008-09-22 10:36 古代 阅读(1408) 评论(0) 推荐(0) 编辑

摘要:http://www.ibm.com/developerworks/cn/xml/x-xformsp3p/index.html初来乍到,看到一篇cookie夸域的帖子,觉的他只是解决了跨二级域名的问题,自己曾经作过一个企业应用的sso,其中用到的p3p解决了cookie跨域的存取。 第一次发帖,请各... 阅读全文

posted @ 2008-09-21 20:05 古代 阅读(1167) 评论(0) 推荐(0) 编辑

摘要:$rfile='F:\web\my\down\tools\wbl.sql';$fp = fopen($rfile,"rb");while(!feof($fp)){ $line = fgets($fp); $i++; if($i>2790) { $data .= $line."\r\n"; } if($i==2799)$data .="\r\n"; if($i>2810) break;}fclo... 阅读全文

posted @ 2008-06-04 16:53 古代 阅读(260) 评论(0) 推荐(0) 编辑

摘要:感谢某位兄弟写的CutString函数 function CutString($_String, $_Length, $_Start=0, $_Encode='GBK'){ $v = 0; if($_Encode == 'UTF-8') { $_Pa = "/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|\xe0[\xa0-\xbf][\x80-\xbf]|[\xe1-\x... 阅读全文

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

摘要:Linux下面PHP开发环境搭建详解-php,mysql,apache以及图形支持库GD的安装 作者:小段公子 2008-01-03 23:56:52 软件安装列表 zlib. mysql php http libpng freetype jpegsrc gd libxml 我都采用源代码安装,因为这样比较灵活,能自己指定安装目录并配置参数,或者进行特性的选取与优化。 说明:所有的包都安... 阅读全文

posted @ 2008-05-26 13:22 古代 阅读(544) 评论(0) 推荐(0) 编辑

摘要:回复后可见造成了大量的垃圾回复,日! update cdb_posts set `message`=REPLACE(`message`,'[hide]','' ) where author ='chi' AND message like '%[hide]%'; update cdb_posts set `message`=REPLACE(`message`,'[/hide]',''... 阅读全文

posted @ 2008-05-04 10:03 古代 阅读(365) 评论(0) 推荐(0) 编辑

摘要:http://developer.mozilla.org/en/docs/Creating_OpenSearch_plugins_for_Firefox http://software.hixie.ch/utilities/cgi/data/data 看起来使用的图位数据就是读图片,然后base64编码,这个我也会啊.呵呵. 阅读全文

posted @ 2008-03-16 23:27 古代 阅读(235) 评论(0) 推荐(0) 编辑

摘要:function array_sum2($a) { //pr($a); //die; if(!is_array($a)) return str_replace(",","",$a); foreach($a as $key=>$value) $totale += array_sum2($value); return $totale; } 阅读全文

posted @ 2008-03-15 00:49 古代 阅读(309) 评论(0) 推荐(0) 编辑

摘要:文件存放对于windows和linux来说,如果你起了个中文名。并且想通过apache来访问这个文件,你有2种途径。1.Linux下安装那个编码转换的模块( mod_encoding )。日本技术员的贡献。不装呢,有如下2中解决办法。2.对于Linux,如果链接是中文,那么必须将中文文件名的GBK表示用rawurlencode编码,然后直接用这个编码后的网址访问。如,对于 http://7game... 阅读全文

posted @ 2008-01-25 17:00 古代 阅读(481) 评论(0) 推荐(0) 编辑

摘要:/* * 此函数将unicode编码字串转为utf8编码字符串 * 参数 str ,unicode编码的字符串。 * 参数 order ,unicode字串的存放次序,为big endian还是little endian. * 返回 utf8string , 转换过的字符串。 * bailing * 2007-12-26 */ function unicodeToUtf8($str,$ord... 阅读全文

posted @ 2007-12-26 15:40 古代 阅读(611) 评论(0) 推荐(0) 编辑

摘要:$arr[]="04-35"; $arr[]="01-35"; $arr[]="03-35"; $arr[]="02-5"; $arr[]="04-15"; $arr[]="01-15"; $arr[]="01-25"; $arr[]="0-1"; $arr[]="0-10"; $arr[]="0-11"; $arr[]="0-12"; $arr[]="0-13&qu 阅读全文

posted @ 2007-12-21 11:26 古代 阅读(410) 评论(0) 推荐(0) 编辑