All articles(网络文学目录) All Pictures(图片目录) All Softwares(软件目录)

 
PHP从映象(Reflection)类中读取属性信息_php资料_编程技术

Writer: aaa Article type: Programming skills(编程技巧) Time: 2013/12/27 19:52:30 Browse times: 357 Comment times: 0

PHP从映象(Reflection)类中读取属性信息_php资料_编程技术


Head photo

Go homepage
Upload pictures
Write articles

PHP从映象(Reflection)类中读取属性信息_php资料_编程技术-你的首页-uuhomepage.com
/**
从映象(Reflection)类中读取属性信息
用该方法可以查看指定类中的方法和属性
*/
include_once 'mycal.php';//一个类文件或采用系统中的类如Exception
$obj = new ReflectionClass('myCal');
//$obj = new ReflectionClass(Exception);
$arr = $obj->getMethods();//取得类中所有的名字
//$arr = $obj->getMethod('Calendar');//取得指定类的名字
//$arr = ReflectionClass::getMethod('myCal');
print_r($arr);
//Reflection::export(new ReflectionClass('ReflectionClass'));//通过此方法可以看到ReflectionClass中所有的属性和方法
?>





There are 0 records,
Comment:
Must be registered users to comment(必须是注册用户才能发表评论)

Disclaimer Privacy Policy About us Site Map
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.