分类:
2008-05-28 21:12:16
1.简易判断ip地址合法性 php程序员之家
1.简易判断ip地址合法性if(!strcmp(long2ip(sprintf("%u",ip2long($ip))),$ip)) echo "is ipn"; phperz.com ---- 6.快速搞定文件下载头部输出header("Content-type: application/x-download"); header("Content-Disposition: attachment; filename=$file_download_name;"); header("Accept-Ranges: bytes"); header("Content-Length: $download_size");echo 'xxx'.......2004-08-19 11:50:30 ---- 7.用header输出ftp下载方式,并且支持断点续传一个例子:header('Pragma: public');header('Cache-Control: private');header('Cache-Control: no-cache, must-revalidate');header('Accept-Ranges: bytes');header('Connection: close');header("Content-Type: audio/mpeg");header("Location:ftp://download:1bk3l4s3k9s2@218.30.116.103/1001/咖哩辣椒/咖喱辣椒.rmvb");.......2004-10-08 13:26:45 ---- 8.替换所有的字符为*$a=" preg_replace("/./","*", $a);用perl的正则替换,方便 ---- 9.正则匹配中文ereg("^[".chr(0xa1)."-".chr(0xff)."] ___FCKpd___0quot;, $str); phperz~com ---- 10.批量替换文本里面的超级链接'.htmlentities('\1').htmlentities('\2').''EOPHP; $ret = $str; while(list(,$type) = each($types)) { $ret = preg_replace("|($type://)([^\s]*)|ie ", $replace, $ret); } return $ret;}?> php程序员之家 |