title: How to print the multidimensional array in advanced way?
body: <p>Following is the code</p>
  
  <pre><code>print_r($_POST).'&lt;br&gt;&lt;br&gt;';
  
  foreach($_POST as $key =&gt; $value){
  if(is_array($value))
  {
      foreach($value as $key =&gt; $value)
      {
      echo "&lt;br&gt;&lt;br&gt;".$key." ".$value."&lt;br&gt;";
      }
  }
  echo "&lt;br&gt;";
  }
  </code></pre>
  
  <p><strong>Output is</strong></p>
  
  <p>Array ( [Cake_on_Name] => Array ( [0] => Rachana [1] => Sarika [2] => Pratik ) [Cake_on_Date] => Array ( [0] => 2017-12-19 [1] => 2017-12-19 [2] => 2017-12-19 ) [Cake_on_Time] => Array ( [0] => 10 A.M [1] => 10 A.M [2] => 10 A.M ) [Cake_Receiver_Name] => Array ( [0] => [1] => [2] => Ashvin Ade ) [Cake_on_Address] => Array ( [0] => [1] => [2] => Amravati ) [pincode] => Array ( [0] => 444607 [1] => 444607 [2] => 444607 ) [cheu] => 1-1@500,54-1@1000,65-1@1000,54-1@300,56-1@1000,65-1@300,54-1@1000 [clientinput] => Add Detail &amp; Buy ) </p>
  
  <p>0 Rachana</p>
  
  <p>1 Sarika</p>
  
  <p>2 Pratik</p>
  
  <p>0 2017-12-19</p>
  
  <p>1 2017-12-19</p>
  
  <p>2 2017-12-19</p>
  
  <p>0 10 A.M</p>
  
  <p>1 10 A.M</p>
  
  <p>2 10 A.M</p>
  
  <p>0 </p>
  
  <p>1 </p>
  
  <p>2 Ashvin Ade</p>
  
  <p>0 </p>
  
  <p>1 </p>
  
  <p>2 Amravati</p>
  
  <p>0 444607</p>
  
  <p>1 444607</p>
  
  <p>2 444607</p>
  
  <p><strong>But I Want Output as :</strong></p>
  
  <p>0 Rachana</p>
  
  <p>0 2017-12-19</p>
  
  <p>0 10 A.M</p>
  
  <p>0</p>
  
  <p>0</p>
  
  <p>0 444607</p>
  
  <p>1 Sarika</p>
  
  <p>1 2017-12-19</p>
  
  <p>1 10 A.M</p>
  
  <p>1</p>
  
  <p>1</p>
  
  <p>1 444607</p>
  
  <p>2 Pratik</p>
  
  <p>2 2017-12-19</p>
  
  <p>2 10 A.M</p>
  
  <p>2 Ashvin Ade</p>
  
  <p>2 Amravati</p>
  
  <p>2 444607</p>