|
extractImport variables into the current symbol table from an array Description
int extract
( array
&$array
[, int $flags = EXTR_OVERWRITE
[, string $prefix = NULL
]] )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. Parameters
Return ValuesReturns the number of variables successfully imported into the symbol table. Changelog
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.
<?php 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, for example if you want to run old code that relies
on register_globals
temporarily, make sure you use one of the non-overwriting
See Also
|