September 2001
Intermediate to advanced
768 pages
32h 45m
English
array compact(mixed varname, [mixed ...]) Creates an array containing variables from the current scope.
Returns:
Associative array
Description:
This function performs the opposite job of extract(). Given one or more variable names, it places each named variable into an associative array, with the key of each element being the name of a variable from the current scope and the value of each element being the value of that variable. The array thus constructed is then returned.
Each parameter can be either a string giving the name of a variable to place into the array, or an array of variable names. Arrays can be nested as deeply as you like; compact() recurses over them.
Variables are skipped if they are not set within the scope in which ...
Read now
Unlock full access