【待修改】validator表单验证类PHP版本
<?php
/*****************
名称:validator For PHP v1.0.0
日期:2006-12-7
作者:西楼冷月
网址:www.xilou.net | www.chinaCMS.org
描述:数据检验类,用在表单验证上
规则:无
*****************/
/*php自身的检测函数
*bool is_numeric ( mixed var)
*bool is_bool ( mixed var)
*bool is_null ( mixed var)
*bool is_float ( mixed var)
*bool is_int ( mixed var)
*bool is_string ( mixed var)
*bool is_object ( mixed var)
*bool is_array ( mixed var)
*bool is_scalar ( mixed var)
*string gettype ( mixed var)
*/
/*新添加的检测函数
isDate() 日期检查
isTime() 时间检查
isInt() 整数检查
isNum() 数字检查
isEmail() 邮件检查
isUrl() url检查
isPost() 邮政编码检查
isPhone() 电话号码检查
isMobile() 移动电话检查
isLen() 长度检查
isIdCard() 身份证检查
isEnglish() 英文检查
isGB2312() 简体中文检查
isIP() IP检查
isQQ() QQ检查
checkFileType() 文件后缀名检查
*/
class Validator{
function Validator(){
//echo "test";
}
/*
*方法:bool isDate($str,$format="")
*作用:检验日期的合法性
*说明:默认的合法日期格式是以"-"分割的"年-月-日"
* 当参数$format设置格式时则按照这个格式检验
*例子:isDate("2006-12-1");isDate("2006-12-1","Y-m-d h:i:s")
*/
function isDate($str,$format=""){
if($format==""){
$str=explode("-",$str);
return @checkdate($str[1],$str[2],$str[0]);
}else{
//按规定的格式检验
$unixTime=strtotime($str);//转为时间戳
$checkDate= date
相关文档:
PHP取得成功的一个主要原因之一是她拥有大量的可用扩展。web开发者无论有何种需求,这种需求最有可能在PHP发行包里找到。PHP发行包包括支持各种数据库,图形文件格式,压缩,XML技术扩展在内的许多扩展。
扩展API的引入使PHP取得了巨大的进展,扩展API机制使PHP开发社区很容易的开发出几十种扩展。。扩展主要的思想是 ......
apache:
如果采用RPM包安装,安装路径应在 /etc/httpd目录下
apache配置文件:/etc/httpd/conf/httpd.conf
Apache模块路径:/usr/sbin/apachectl
web目录:/var/www/html
如果采用源代码安装,一般默认安装在/usr/local/apache2目录下
php:
如果采用RPM包安装,安装路径应在 /etc/目录下
php的配置文件:/etc/php.ini
......
/ ok
header('HTTP/1.1 200 OK');
//设置一个404头:
header('HTTP/1.1 404 Not Found');
//设置地址被永久的重定向
header('HTTP/1.1 301 Moved Permanently');
//转到一个新地址
header('Location: http://www.example.org/'
);
//文件延迟转向:
header('Refresh: 10; url=http://www.example.org/');
print 'Y ......
#
启动服务的用户和组
user
lighttpd lighttpd;
#
开多少进程
worker_processes
2;
#
错误日志
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors t ......