SHARE
TWEET

PHP code for parsing POST array

a guest Aug 5th, 2014 451 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $data_keys = array();
  2. $data_values = array();
  3. $iter = 0;
  4. foreach ($_POST['inputs'] as $info)
  5. {
  6.         if(is_array($info))
  7.         {
  8.                 $i = 0;
  9.                 foreach ($info as $item)
  10.                 {
  11.                         if($iter == 0) // type
  12.                                 $data_keys[$i] = $item;
  13.                         if($iter == 1) // value
  14.                                 $data_values[$i] = $item;
  15.                                                
  16.                         $i++;
  17.                 }
  18.                 $iter++;
  19.         }
  20. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top