array to vars php function - make array keys available as variables

There is a handy php function, called extract() ,that can be applied to a string-indexed array. It takes its key-value pairs and makes them available to the script as variables. These newly created variables are named after the original array’s keys and they hold the appropriate values that were once associated with those keys). Officially the : variables are imported into the ‘current symbol table’

I use this function rarely and always forget what its called. Furthermore, I always struggle to dig it up via a Google searchs.

HERE IS THE PLACE TO READ MORE:

http://uk3.php.net/manual/en/function.extract.php

These are the searches that i tried :

* array to vars
* array to vars php
* array to vars php scope
* export array variable variables
* make array values available as primitive variables in environment php
* dumping array variable variables
* export array variable variables php

None of the above gave me the answer.

I had to resort to finding my answer, all by myself, in the traditional manner. Namely, by browsing the array functions page in the php documentation. Its a tough life eh!

Leave a Reply