1. Get_defined_vars(PHP 4 >= 4.0.4, PHP 5)-Gets an array of all the defined variables
Array get_defined_vars (void)
This function returns a multidimensional array that contains the list of all defined variables, including environment variables, server variables, and user-defined variables.
Copy Code code as follows:
<?php
Echo ' <pre> ';
$b = Array (1,1,2,3,5,8);
$arr = Get_defined_vars ();
Print $b
Print_r ($arr ["B"]);
Print all server variables
Print_r ($arr ["_server"]);
Print all available key values for a 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 is null and does not require any arguments
<?php
Echo ' <pre> ';
function foo ()
{
echo "This are my function foo";
}
$arr = Get_defined_functions ();
Print_r ($arr);
?>
3. Get_loaded_extensions(PHP 4, PHP 5)-Get all available modules
Copy Code code as follows:
<?php
Echo ' <pre> ';
Print_r (Get_loaded_extensions ());
?>
4. Get_extension_funcs(PHP 4, PHP 5)-Get the available functions for the specified module
Array Get_extension_funcs (string $module _name) This function returns all available functions for the specified module. Parameters passed in (module name) must be lowercase
Copy Code code 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)-Gets the name of the associative array all the constants and their value
Array get_defined_constants ([bool $categorize = false])
Copy Code code as follows:
<?php
Echo ' <pre> ';
Define ("My_constant", 1);
Print_r (Get_defined_constants (true));
?>
6. Get_declared_classes(PHP 4, PHP 5)-Gets an array of the names of the defined classes
Array get_declared_classes (void)
Copy Code code as follows:
<?php
Echo ' <pre> ';
//define Classone
class Classone {}
//define Classtwo
class Classtwo {}
//this'll show X class ES (built-ins, extensions etc) with
//classone and Classtwo as the last two elements
Print_r (Get_declared_classe s ());
//define Classthree
class Classthree {}
//...and four
class Classfour {}
//shows the same result As before with class three and four appended
Print_r ());
?>