已知一个php的文件,怎么知道这个文件里面是否含有类,类名是什么

WBOY
Release: 2016-06-13 13:22:12
Original
907 people have browsed it

已知一个php的文件,如何知道这个文件里面是否含有类,类名是什么?
已知一个php的文件,如何知道这个文件里面是否含有类,类名是什么?谢谢大家

------解决方案--------------------
$old = get_declared_classes();
include '文件名';
$new = get_declared_classes();
print_r(array_diff($new, $old));


当然你也可以读取文件用正则表达式搜索

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template