Hello All,
Is there a way to get user-defined php functions, variables, constants from a php file? Following functions are not the best way to do so because they get all decalred functions/vars/constants (with hundreds of php's built-in constants and internal php functions):
get_defined_vars
get_defined_functions
get_defined_constants
Suppose i have this file myfile.php:
<?php
$title = 'Sample Application';
$copyright = 'Copyright © 2009';
$my_array = array('sarfraz', 'ahmed', 'chandio');
define ('_CASTE', 'chandio');
define ('_COUNTRY', 'Pakistan');
function add($val1, $val2)
{
return ($val1 + $val2);
}
function subtract($val1, $val2)
{
return ($val1 - $val2);
}
?>
Now how can i get all variables/functions/constants from that file and probably store in an array?
Thanks