Php outputs all variables, constants, modules, functions, and classes of the current process.
- Echo'
'; -
- $ 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.
- Echo'
'; -
- 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
- Echo'
'; - print_r(get_loaded_extensions());
- ?>
4. get_extension_funcs(PHP 4, PHP 5)-Get the available function array get_extension_funcs (string $ module_name) of the specified module. This function returns all available functions of the specified module. The input parameter (module name) must be in lowercase.
- Echo'
'; -
- 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 all constants associated with the array and their values. array get_defined_constants ([bool $ categorize = false])
- Echo'
'; -
- define("MY_CONSTANT", 1);
- print_r(get_defined_constants(true));
- ?>
6. get_declared_classes(PHP 4, PHP 5)-Get the array get_declared_classes (void) consisting of the names of the defined classes)
- Echo'
'; -
- //define classone
- class classone { }
-
- //define classtwo
- class classtwo { }
-
- //This will show X classes (built-ins, extensions etc) with
- //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());
- ?>
|