Posted By

titosemi on 12/12/10


Tagged

textmate variables automated


Versions (?)

titosemi


 / Published in: PHP
 

  1. // Get $_POST values
  2. $post_keys = array_keys($_POST);
  3. $post_values = array_values($_POST);
  4.  
  5. // Automatically assign the $_POST values into variables with it's key
  6. for($i=0; $i <= count($_POST); $i++) {
  7. $$post_keys[$i]= $post_values[$i];
  8. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: titosemi on December 12, 2010

After that you can call the variables as normal, if it was submitted let's say $_POST['name'] = 'titosemi'; you will have a variable called $name with a value of 'titosemi'

You need to login to post a comment.