PHP outputs all variables of the current process. constant module function class 1 .? Get_defined_vars ?? (PHP4 & gt; 4.0.4, PHP5 )? -Get an array composed of all defined variables? Array? Get_defined_vars? (? Void ?)? This function returns a multidimensional array containing a list of all defined variables, including environment variables, server variables, and all the variables/constants/modules/functions/classes of the current process output by PHP.
1 .? Get_defined_vars??(PHP 4> = 4.0.4, PHP 5 )? -Get an array composed of all defined variables
?
Array?Get_defined_vars? (? Void ?)
?
This function returns a multidimensional array containing the list of all defined variables, including environment variables, server variables, and user-defined variables.
?
'; $ B = array (,); $ arr = get_defined_vars (); // Print $ bprint_r ($ arr ["B"]); // print all SERVER variables print_r ($ arr ["_ SERVER"]); // print all available key values of the variable array print_r (array_keys (get_defined_vars ();?>
?
2 .? Get_defined_functions?(PHP 4> = 4.0.4, PHP 5 )? -? Obtain all defined functions
?
Array get_defined_functions (void) // void indicates that it is null and no parameter is required.
?
';function foo(){ echo "This is my function foo";}$arr = get_defined_functions();print_r($arr);?>
?
3 .? Get_loaded_extensions? (PHP 4, PHP 5 )? -? Obtain all available modules
?
';print_r(get_loaded_extensions());?>
?
4 .? Get_extension_funcs? (PHP 4, PHP 5 )? -? Obtains available functions of a specified module.
?
Array?Get_extension_funcs? (? String?$module_name
?)? This function returns all available functions of the specified module. The input parameter (module name) must be in lowercase.
?
';print_r(get_extension_funcs("gd"));print_r(get_extension_funcs("xml"));?>
?
5 .? Get_defined_constants? (PHP 4> = 4.1.0, PHP 5 )? -? Obtain the names of associated arrays, all constants, and their values.
?
Array?Get_defined_constants? ([? Bool?$categorize
? = False?] )
?
';define("MY_CONSTANT", 1);print_r(get_defined_constants(true));?>
?
6 .? Get_declared_classes?(PHP 4, PHP 5 )? -?? Obtains an array composed of the names of defined classes.
?
Array?Get_declared_classes? (? Void ?)
?
';//define classoneclass classone { }//define classtwoclass classtwo { }//This will show X classes (built-ins, extensions etc) with//classone and classtwo as the last two elementsprint_r(get_declared_classes());//define classthreeclass classthree { }//...and fourclass classfour { }//Shows the same result as before with class three and four appendedprint_r(get_declared_classes());?>
?
?
?
?