title: Post request with file_get_contents with arrays
body: <p>Im trying post a request via <strong>file_get_contents</strong> but i'm getting <strong>error 500</strong>, i'm doing this:</p>
  
  <pre><code>   $params = array("pid" =&gt; "000209", "main_widget_pid" =&gt; "000209");
  
      $array = array("method" =&gt; "bottomline","params" =&gt; $params);
  
      $url = 'http://example.com/test';
      $data = array('app_key' =&gt; '8948a6aa12a1a23Yzglj17QO91Geg', 'methods' =&gt; $array);
  
      $options = array(
          'http' =&gt; array(
              'header'  =&gt; "Content-type: application/x-www-form-urlencoded\r\n",
              'method'  =&gt; 'POST',
              'content' =&gt; http_build_query($data),
          ),
      );
  
  $context  = stream_context_create($options); 
  $result = file_get_contents($url, false, $context);
  var_dump($result);
  </code></pre>
  
  <p>I believe the problem is in the structure of arrays. But I can not see the problem.</p>
  
  <p>Can anyone give me a way?</p>