Name
compact
Synopsis
array compact(mixedvariable1
[, ... mixedvariableN
])
Creates an array by retrieving the values of the variables
named in the parameters. If any of the parameters are arrays, the
values of variables named in the arrays are also retrieved. The
array returned is an associative array, with the keys being the
arguments provided to the function and the values being the values
of the named variables. This function is the opposite of extract( )
.
Get Programming PHP, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.