易截截图软件、单文件、免安装、纯绿色、仅160KB

php常用技巧

如何判断ip地址合法性
if(!strcmp(long2ip(sprintf("%u",ip2long($ip))),$ip)) echo "is ipn";
 email的正则判断
eregi("^[_.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z_-]+.)+[a-zA-Z]$", $email);
检测ip地址和mask是否合法的例子
$ip = '192.168.0.84';
$mask = '255.255.255.0';
$network = '192.168.0';
$ip = ip2long($ip);
$mask = ip2long($mask);
$network = ip2long($network);
if( ($ip & $mask) == $network) echo "valid ip and maskn";
?>
文件下载头部输出如何设定
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'
用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@232.2.22.22/2222/web技术开发知识库/cn_web.rmvb");
正则匹配中文
ereg("^[".chr(0xa1)."-".chr(0xff)."]+$", $str);
批量替换文本里面的超级链接
<?php
function urlParse($str = ''){
    if ('' == $str) return $str;
$types = array("http", "ftp", "https");
$replace = <<<EOPHP
  '<a href="'.htmlentities('\1').htmlentities('\2').'">'.htmlentities('\1').htmlentities('\2').'</a>'
EOPHP;
$ret = $str;
while(list(,$type) = each($types)){
  $ret = preg_replace("|($type://)([^\s]*)|ie ", $replace, $ret);
}
return $ret;
}
?>


相关文档:

ubuntu 下 搭建 apache+php+mysql


#apt-get install apache2
//安装apahce2
#apt-get install php5
//安装php5
#apt-get install mysql-server
//安装mysql服务端
#apt-get install  mysql-myclient
//安装mysql的客户端
#apt-get install php-mysql
//安装php-mysql的连结
apache+php+mysql 环境已经搭建好了
将以下的服务重启一下
#/et ......

php显示服务器时间代码

<div id="time" align="center">time </div> 
<script language="javascript">
function time1()
{
var now,n,y,r,h,m,s;
now=new Date();
n = now.getYear();
y = now.getMonth()+1;
r = now.getDate();
h = now.getHours();
m =now.getMinutes();
s = now.getSeconds();
......

国外十大最流行PHP框架

以下为十个目前最流行的基于MVC设计模式的PHP框架。
1. Yii
Yii是一个基于组件的高性能的PHP的框架,用于开发大规模Web应用。Yii采用严格的OOP编写,并有着完善的库引用以及全面的教程。从MVC,DAO/ActiveRecord,widgets,caching,等级式RBAC,Web服务,到主体化,I18N和L10N,Yii提供了今日Web 2.0应用开发所需要的几 ......

php生成验证码图片代码

文件check.php
<?php
//生成验证码图片
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);//播下一个生成随机数字的种子,以方便下面随机数生成的使用
session_start();//将随机数存入session中
$_SESSION['authnum']="";
$im = imagecreate(62,20); //制定图片背景大小
$black = ImageC ......

php的数据操作ui

 <?php
 
error_reporting(0);//7all,0no
ini_set('display_errors', '0');
function myerror($errno, $errstr, $errfile, $errline)
{
    echo "<BR>error type: [$errno] $errstr<br />\n";
    echo "in line $errline of file $errfile<BR>";
} ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号