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.
Copy codeThe Code is as follows:
<? Php
Echo '<pre> ';
$ B = array );
$ Arr = get_defined_vars ();
// Print $ B
Print_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)-Get all defined functions
Array get_defined_functions (void) // void indicates that it is null and no parameter is required.
<? Php
Echo '<pre> ';
Function foo ()
{
Echo "This is my function foo ";
}
$ Arr = get_defined_functions ();
Print_r ($ arr );
?>
3. get_loaded_extensions(PHP 4, PHP 5)-Get all available modules
Copy codeThe Code is as follows:
<? Php
Echo '<pre> ';
Print_r (get_loaded_extensions ());
?>
4. get_extension_funcs(PHP 4, PHP 5)-obtain 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.
Copy codeThe Code is as follows:
<? Php
Echo '<pre> ';
Print_r (get_extension_funcs ("gd "));
Print_r (get_extension_funcs ("xml "));
?>
5. get_defined_constants(PHP 4> = 4.1.0, PHP 5)-Get the names of associated arrays, all constants, and their values
Array get_defined_constants ([bool $ categorize = false])
Copy codeThe Code is as follows:
<? Php
Echo '<pre> ';
Define ("MY_CONSTANT", 1 );
Print_r (get_defined_constants (true ));
?>
6. get_declared_classes(PHP 4, PHP 5)-Get an array composed of the names of the defined classes
Array get_declared_classes (void)
Copy codeThe Code is as follows:
<? Php
Echo '<pre> ';
// Define classone
Class classone {}
// Define classtwo
Class classtwo {}
// This will show X classes (built-ins, extensions etc)
// Classone and classtwo as the last two elements
Print_r (get_declared_classes ());
// Define classthree
Class classthree {}
//... And four
Class classfour {}
// Shows the same result as before with class three and four appended
Print_r (get_declared_classes ());
?>