Posted By

DavidAspden on 12/22/08


Tagged

post forms


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

jeremyhcobb


Post2Multi


 / Published in: PHP
 

Allows me to work with forms a little easier!

  1. //Split an array into two colums
  2. //Use in simple loop
  3. //Help to update functions
  4. function post2Multi($post){
  5. $updates = array();
  6. $names= array_keys($post);
  7. for($i=0; $i<count($post); $i++){
  8. $updates[0][] = $names[$i];
  9. $updates[1][] = $post[$names[$i]];
  10. }
  11. return $updates;
  12. }

Report this snippet  

You need to login to post a comment.