Getting all defined variables

suggest change

get_defined_vars() returns an array with all the names and values of the variables defined in the scope in which the function is called. If you want to print data you can use standard functions for outputting human-readable data, like print_r or var_dump.

var_dump(get_defined_vars());

Note: The result is only the variables in the scope that called it. In a function, that is the function's local variables, not the superglobals, unless they were imported with global. With auto_globals_jit enabled (the default), $_SERVER, $_REQUEST, and $_ENV are created the first time the script uses them. The CLI SAPI still provides $_SERVER, $argv, and $argc. $_GET, $_POST, $_COOKIE, and $_FILES are created at startup.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents