title: Posting parameters and array in header in CURL using PHP
body: <p>i am facing an issue i just need to send an array in header and some parameters in body but when i add </p>
  
  <pre><code>curl_setopt($curl, CURLOPT_HTTPHEADER, array('Token:'.$token));
  </code></pre>
  
  <p>this line sends token but parameters array get empty but when i just remove the line, parameters successfully send  but token is missing</p>
  
  <p>here is the code have look:</p>
  
  <pre><code>      $data = array(
  
          'name' =&gt; $_POST['name'],
          'city' =&gt; $_POST['city'],
          'mobileNo' =&gt; $_POST['mobileNo'],
        );
  
        $params = http_build_query($data);
        $curl = curl_init('URL');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_POST, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $params);
        curl_setopt($curl, CURLOPT_HTTPHEADER, 
        array('Token:'.$token));
        $result = curl_exec($curl);
  </code></pre>