|
extractImport variables into the current symbol table from an array Description
int extract(array
&$array , int $flags = EXTR_OVERWRITE , string $prefix = "")Import variables from an array into the current symbol table. Checks each key to see whether it has a valid variable name. It also checks for collisions with existing variables in the symbol table. Warning
Do not use extract on untrusted data, like user input (e.g. $_GET, $_FILES). Parameters
Return ValuesReturns the number of variables successfully imported into the symbol table. Examples
Example #1 extract example A possible use for extract is to import into the symbol table variables contained in an associative array returned by wddx_deserialize.
The above example will output: blue, large, sphere, medium
The $size wasn't overwritten because we specified
NotesWarning
Do not use extract on untrusted data, like
user input
(i.e. $_GET, $_FILES, etc.).
If you do, make sure you use one of the non-overwriting
See Also
|