Are there any way for me to use PHP to parse information of a PHP file, something likes : what functions/classes it has, which functions are built-in/user-defined or how many variables are there....?
1 Answer
You can use the function token_get_all() to parse PHP source.
$source = file_get_contents('my-file.php');
$tokens = token_get_all($source);
1 Comment
Tom Gruner
There was also some discussion about this here: stackoverflow.com/questions/5068007/…