PHP get_defined_vars() Function
❮ PHP Variable Handling Reference
Example
Return all defined variables, as an array:
<?php
$a = array("red", "green", "blue");
$arr = get_defined_vars();
print_r($arr["a"]);
?>
Try it Yourself »
Definition and Usage
The get_defined_vars() function returns all defined variables, as an array.
Syntax
get_defined_vars();
Parameter Values
None.
Technical Details
Return Value: | All the defined variables as a multidimensional array |
---|---|
Return Type: | Array |
PHP Version: | 4.0.4+ |
❮ PHP Variable Handling Reference