Sunday, October 29, 2006

PHP : variable names by form fields

Here's a quick way to make form fields accessible just by appending a $ sign as in old php3.
Notice the two $ signs.

foreach ($_POST as $key=>$val)
{
 $$key=$val;
}

No comments: