Query: get_defined_vars
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
GET_DEFINED_VARS(3) 1 GET_DEFINED_VARS(3) get_defined_vars - Returns an array of all defined variablesSYNOPSISarray get_defined_vars (void )DESCRIPTIONThis function returns a multidimensional array containing a list of all defined variables, be them environment, server or user-defined variables, within the scope that get_defined_vars(3) is called.RETURN VALUESA multidimensional array with all the variables.EXAMPLESExample #1 get_defined_vars(3) Example <?php $b = array(1, 1, 2, 3, 5, 8); $arr = get_defined_vars(); // print $b print_r($arr["b"]); /* print path to the PHP interpreter (if used as a CGI) * e.g. /usr/local/bin/php */ echo $arr["_"]; // print the command-line parameters if any print_r($arr["argv"]); // print all the server vars print_r($arr["_SERVER"]); // print all the available keys for the arrays of variables print_r(array_keys(get_defined_vars())); ?>SEE ALSOisset(3), get_defined_functions(3), get_defined_constants(3). PHP Documentation Group GET_DEFINED_VARS(3)
Related Man Pages |
---|
array_map(3) - php |
collator_asort(3) - php |
collator_sort(3) - php |
locale_get_all_variants(3) - php |
print_r(3) - php |
Similar Topics in the Unix Linux Community |
---|
Arrays in perl |
Integer array length |
Arrays |
PHP: declared variables, strlen vs isset |
Compare two variables and print the difference |