title: Post multidimensional array using CURL and get the result on server
body: <p>I am sending data from my local machine to server using <code>CURL</code>. And the data is multidimensional array.</p>
  
  <pre><code>Array
  (
  [0] =&gt; stdClass Object
      (
          [id] =&gt; 1
      )
  [1] =&gt; stdClass Object
      (
          [id] =&gt; 0
      )
  [2] =&gt; stdClass Object
      (
          [id] =&gt; 11
      )
  )
  </code></pre>
  
  <p>I am using this below code for sending the data.</p>
  
  <pre><code>$ch = curl_init();
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_VERBOSE, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_URL, "my_url");
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $array);  // $array is my above data
  </code></pre>
  
  <p>But at server when I try to put this incoming data to file or just <code>print_r</code> it gives me this below output</p>
  
  <pre><code>Array
  (
  [0] =&gt; Array
  [1] =&gt; Array
  [2] =&gt; Array
  )
  </code></pre>
  
  <p>But I want the output in multidimensional.</p>
  
  <p>I tried with <code>print_r($_POST[0])</code> but it gives only <code>Array</code> text.</p>