title: PHP access all $_POST[] variables into an array?
body: <p>how to capture all fields in the <code>$_POST</code> VARIABLE?
  into an array?</p>
  
  <pre><code>$email = $_POST;
  $emails = array_keys($email);
  foreach($emails as $email) {
          echo '$' . nl2br($email);
  }
  $emailadd = new email_save;
  $emailadd-&gt;insert_email_into_database("POST VARIABLES GO HERE)
  </code></pre>
  
  <p>I'm trying to make an email list, name and email address,
  how do I capture all the variables that where posted that can normal be accessed like
  <code>$_POST['email']</code> into an array so i can add them to the arguments in my functions?</p>
  
  <p>My form field has 5 fields.
  The method is POST.</p>
  
  <p>Instead of writing,</p>
  
  <pre><code>$email = mysql_real_escape_string($_POST['email']);
  $firstname = mysql_real_escape_string($_POST['firstname']);
  </code></pre>
  
  <p>I'm trying to access all the values in the $_POST[] array;
  So I can save time getting posted variables
  and add functions to those variables like <code>mysql_real_escape_string();</code></p>
  
  <p>Other security measures will be figured out.</p>
  
  <p>I want to be able to add a reffrence of the array to a function so I can add them to the database.</p>