【待修改】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
相关文档:
准备:
lighttpd-1.4.15.tar.gz
php-4.4.2.tar.gz
mysql-5.0.20a.tar.gz
开始:
1 编译安装lighttpd
# tar zxvf lighttpd-1.4.15.tar.gz
# cd lighttpd-1.4.15
# ls
# ./configure --prefix=/usr/local/lighttpd //此部无法编译时提示安装prce-devel
#&nbs ......
本文提供了20个非常有用的PHP类库的名称和下载地址。这20个PHP类库包含了图标库,RSS解析,缩略图生成,支付,OpenID,数据库抽 象,PDF生成器等一系列功能。
下面是一些非常有用的PHP类库,相信一定可以为你的WEB开发提供更好和更为快速的方法。
图表库
下面的类库可以让你很简的创建复杂的图表和图片。当然,它们需要G ......
由于公司项目的需要,最经在研究Quercus一个纯java的php引擎。项目这两个需要做的就是将该引擎裁剪,做一个相对安全的版本,提供给ISV使用,同时,在引擎中提供默认的接口供调用。所以先研究了一下,在Quercus引擎的支持下,PHP如何与java集成。
以下是学习到的几点:
1、如果使用 Resin-IoC/WebBeans来组织应用的服 ......
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
......
程序代码
<!--p
if(isset($_POST['md5'])){ //判断$md5是否已设置,如果设置了则执行以下代码。
if(!is_numeric($_POST['time'])){ //如果没获取到time的值则将time的值设置为30
$_POST['time'] = 30;
}
set_time_limit($_P ......