Skip to content

Instantly share code, notes, and snippets.

@endigo9740
Created November 28, 2012 19:56
Show Gist options
  • Save endigo9740/4163735 to your computer and use it in GitHub Desktop.
Save endigo9740/4163735 to your computer and use it in GitHub Desktop.
PHP: Dynamic Post Var Assignment
foreach($_POST as $key => $value) {
$$key = $value;
// $$key = addslashes(trim($value)); // Sanitized Version
}
// Source: http://www.daniweb.com/web-development/php/threads/148513/assigning-dynamic-post-variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment