Complete PHP Array Reference
The extract() function imports variables into the local symbol table from an array.
This function uses array keys as variable names and values as variable values. For each element it will create a variable in the current symbol table.
This function returns the number of variables extracted on success.
| Parameter | Description |
|---|---|
| array | Required. Specifies the array to use |
| extract_rules | Optional. The extract() function checks for invalid
variable names and collisions with existing variable names. This parameter
specifies how invalid and colliding names are treated. Possible values:
|
| prefix | Optional. If EXTR_PREFIX_SAME, EXTR_PREFIX_ALL,
EXTR_PREFIX_INVALID or EXTR_PREFIX_IF_EXISTS are used in the extract_rules
parameter, a specified prefix is required.
This parameter specifies the prefix. The prefix is automatically separated from the array key by an underscore character. |
The output of the code above will be:
With all parameters in use:
The output of the code above will be:
Complete PHP Array Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $7.95/mo SEO Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Free Website Templates Free CSS Templates |
| Make Your Own Website |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|