How can the extract() function be used in PHP and what are its potential drawbacks?

The extract() function in PHP can be used to import variables into the current symbol table from an array. This can be useful for simplifying code by directly accessing array values as variables. However, it can lead to potential conflicts and security vulnerabilities if not used carefully.

// Example of using extract() function
$data = array("name" => "John", "age" => 30);
extract($data);

echo $name; // Output: John
echo $age; // Output: 30