.


Divya

extract() Function in PHP


In PHP the extract() function is used to imports variables into the local symbol table from an array.

Syntax

extract(array,extract_rules,prefix)

Example

<!DOCTYPE html>
<html>
<body>
<?php $a = "Original"; $m_array = array("a" => "students","b" => "tutorial"); extract($m_array); echo "\$a = $a; \$b = $b;"; ?>
</body>
</html>
Output

$a = students; $b = tutorial



.