The deal here is that I have an array with 17 elements. I want to get the elements I need for a certain time and remove them permanently from the array.
Here\'s the
I understand this question is old, but I think an optimal way might be to do this:
$vars = array('name', 'email', 'address', 'phone'); /* needed variables */
foreach ($vars as $var) {
${$var} = $_POST[$var]; /* create variable on-the-fly */
unset($_POST[$var]); /* unset variable after use */
}
Now, you can use $name, $email, ... from anywhere ;)
NB: extract() is not safe, so it's completely out of question!