- Echo '
'; - $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 ()));
Copy Code2. Get_defined_functions (PHP 4 >= 4.0.4, PHP 5)-Get all the functions that have been defined array get_defined_functions (void)//void is empty, no parameters are required
- Echo '
'; - function foo ()
- {
- echo "This is my function foo";
- }
- $arr = Get_defined_functions ();
- Print_r ($arr);
-
Copy Code3. Get_loaded_extensions (PHP 4, PHP 5)-Get all available modules
- Echo '
'; - Print_r (Get_loaded_extensions ());
Copy Code4. Get_extension_funcs (PHP 4, PHP 5)-Gets the available functions of the specified module array get_extension_funcs (string $module _name) The function returns all available functions for the specified module. The parameter passed in (module name) must be lowercase
- Echo '
'; - Print_r (Get_extension_funcs ("GD"));
- Print_r (Get_extension_funcs ("xml"));
Copy Code5. Get_defined_constants (PHP 4 >= 4.1.0, PHP 5)-Gets the name of the associated array all constants and their value array get_defined_constants ([bool $categorize = False])
- Echo '
'; - Define ("My_constant", 1);
- Print_r (Get_defined_constants (true));
Copy Code6. Get_declared_classes (PHP 4, PHP 5)-Gets an array of the names of the defined classes arrays get_declared_classes (void)
- Echo '
'; - Define Classone
- Class Classone {}
-
- Define Classtwo
- Class Classtwo {}
-
- This'll show X classes (built-ins, extensions etc) with
- Classone and Classtwo as the last of the 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 ());
Copy Code |