title: PHP: is there a safe way to extract($_POST)
body: <p>Is there a safe way to auto assign the keys in a posted array? Below are two examples of wrong ways...</p>
  
  <pre><code>foreach( $_POST as $key =&gt; $value ) {
       $$key = $value;
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>extract($_POST)
  </code></pre>
  
  <p>Is there a better way, or is it best to code:</p>
  
  <pre><code>$foo = $_POST('foo');
  $bar = $_POST('bar');
  ....
  </code></pre>
  
  <p>for all 50 inputs on my form?</p>
  
  <p>(the posted info will be inserted into a database).</p>