daily pastebin goal
22%
SHARE
TWEET

Untitled

a guest Apr 17th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. $inputArray = [
  4.     0 => [],
  5.  
  6.     1 => [],
  7.  
  8.     2 => [
  9.         0 => [
  10.             'proID' => 15,
  11.             'proUsername' => ''
  12.         ]
  13.     ],
  14.  
  15.     3 => [],
  16.  
  17.     4 => [
  18.         0 => [
  19.             'proID' => 12,
  20.             'proUsername' => ''
  21.         ],
  22.         1 => [
  23.             'proID' => 14,
  24.             'proUsername' => ''
  25.         ]
  26.     ]
  27.  
  28. ];
  29.  
  30. $outputArray = [];
  31. foreach($inputArray as $data) {
  32.     if (!empty($data)) {
  33.         $outputArray = array_merge($outputArray, $data);
  34.     }
  35. }
  36.  
  37. echo "<pre>";
  38. print_r($outputArray);
  39. echo "</pre>";
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