extract is a "quick and dirty" way to take all of the values in an associative array, and put them into variables with the same name as the keys. For example, let's say you have a database of people, and your query returns the first name, last name, and department. Your data row might look like this:
Code:
$employee = array("first_name" => "George",
"last_name" => "Smith",
"dept" => "Accounting");
If you run extract($employee), you will end up with three variables:
Code:
$first_name = "George"
$last_name = "Smith"
$dept = "Accounting"
Make sense?
If you want more information about this, or in fact any function that you need more information on, check the php manual at
www.php.net. In fact, accessing the manual is easy. If you know the function you want to look up, just type in
www.php.net/functionname and it will take you right to the page. You'll find help for extract() at
http://www.php.net/extract.
Hope that helps!
BuzzLY
aka Michael K. Glass
Author, Beginning PHP, Apache, MySQL Web Development