The phpextract function uses the array key name as the variable name and the array key value as the variable value. This function can process form submission and insert data into the database. This article will explain the basic usage and examples of the extract function. For more information, see The php array processing function extract.
The extract function is used to import variables from an array to the current symbol table.
Basic syntax
Int extract (array & $ var_array [, int $ extract_type = EXTR_OVERWRITE [, string $ prefix = NULL])
This function is used to import variables from the array to the current symbol table. Check each key name to see if it can be used as a valid variable name, and check for conflicts with existing variable names in the symbol table.
Parameter introduction:
Return value
Returns the number of variables successfully imported to the symbol table.
Instance:
"Blue", "size" => "medium", "shape" => "sphere"); extract ($ var_array, EXTR_PREFIX_SAME, "wddx"); echo "$ color, $ size, $ shape, $ wddx_size
";?>
Running result:
Blue, large, sphere, medium
Thank you for reading this article. I hope it will help you. thank you for your support for this site!
For more details about the php array processing function extract and related articles on instance code, please follow the PHP Chinese network!