php常见的判断函数

一、文件、目录

1、is_file();//文件是否存在

2、is_dir();//目录是否存在

二、函数、类、接口

1、function_exists();//函数是否存在

bool function_exists ( string $function_name )

2、class_exists();//检测类是否已定义

bool class_exists ( string $class_name [, bool $autoload ] )

3、interface_exists();//检查接口是否已定义

bool interface_exists ( string $interface_name [, bool $autoload ] )

4、method_exists() ;// 检查类的方法是否存在

bool method_exists ( object $object , string $method_name )

5、property_exists() ;检查对象或类是否具有该属性

bool property_exists ( mixed $class , string $property )

 

posted @ 2014-03-17 16:05  joshua317  阅读(171)  评论(0编辑  收藏  举报