The function of the PHP extract () function is to distribute the array key values as functions of variables and values extract detailed.
Extract (Array,extract_rules,prefix)
Array required.
Specifies the input to use.
Extract_rules is optional.
The extract () function checks to see if each key name is a valid variable name, and also checks whether the variable names in the symbol table conflict. The handling of illegal, numeric, and conflicting key names is determined by this parameter. Can be one of the following values: Possible values:
Extr_overwrite-Default. If there is a conflict, overwrite the existing variable.
Extr_skip-If there is a conflict, do not overwrite the existing variable. (ignores elements with the same name in the array)
Extr_prefix_same-If there is a conflict, precede the variable name with the prefix PREFIX. Since PHP 4.0.5, this also includes the processing of the digital index.
Extr_prefix_all-Prefix all variable names with PREFIX (the third argument).
Extr_prefix_invalid-prefix PREFIX only before illegal or numeric variable names. This tag is a new addition to PHP 4.0.5.
Extr_if_exists-Overrides the value of a variable with the same name in the current symbol table only. None of the others will deal with it. It can be used where a set of valid variables has been defined and then extracted from an array such as $_request to override those variables. This tag is a new addition to PHP 4.2.0.
Extr_prefix_if_exists-A variable name with the prefix appended to it is created only if a variable with the same name already exists in the current symbol table, and none of the others are processed. This tag is a new addition to PHP 4.2.0.
Extr_refs-Extracts the variable as a reference. This strongly demonstrates that the imported variable still references the value of the Var_array parameter. This flag can be used alone or in conjunction with any other flag in Extract_type. This tag is a new addition to PHP 4.3.0.
prefix is optional.
Note that prefix is required only if the value of Extract_type is Extr_prefix_same,extr_prefix_all,extr_prefix_invalid or extr_prefix_if_exists. If the result appended with the prefix is not a valid variable name, it will not be imported into the symbol table. An underscore is automatically added between the prefix and the array key name.