title: PHP cURL - Strange problem with curl_setopt
body: <p>I have a very strange problem, here is my code :</p>
  
  <pre><code>function myFunction($id, $name, $secret) {
  
          $ch = curl_init();
  
          curl_setopt($ch, CURLOPT_URL, 'https://www.myurl.com/api');
          curl_setopt($ch, CURLOPT_POST, 1);
  
          curl_setopt($ch, CURLOPT_POSTFIELDS, 
                   http_build_query(
                      array(
                          'Client_id'     =&gt; $id,
                          'Client_secret' =&gt; $secret, // $secret = Ve6UZ0cox=ry?2F9&gt;qegmB:NCh?EQS?]cKmkjeHjS=3t1=E&lt;RJ
                          'Client_name'   =&gt; $name
                      )));
  
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  
          $results = curl_exec($ch);
          $results = json_decode($results, true);
  
          print_r($results);
  
          curl_close ($ch);
  
          // curl_close($curl);
          return $results['Token_type'].' '.$results['Access_token'];
      }
  </code></pre>
  
  <p>The code above doesn't work, probably due to special chars in $secret.
  But, when I directly write the $secret value, it works!</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, 
                       http_build_query(
                          array(
                              'Client_id'     =&gt; $id,
  
                              // Now, it works!
                              'Client_secret' =&gt; 'Ve6UZ0cox=ry?2F9&gt;qegmB:NCh?EQS?]cKmkjeHjS=3t1=E&lt;RJ'
                              'Client_name'   =&gt; $name
                          )));
  </code></pre>
  
  <p>Conclusion:</p>
  
  <pre><code>'Client_secret' =&gt; $secret // Doesn't work
  'Client_secret' =&gt; 'Ve6UZ0cox=ry?2F9&gt;qegmB:NCh?EQS?]cKmkjeHjS=3t1=E&lt;RJ' // Work!
  </code></pre>
  
  <p>And yes, I tried this: <code>die($secret);</code>, which displays <code>Ve6UZ0cox=ry?2F9&gt;qegmB:NCh?EQS?]cKmkjeHjS=3t1=E&lt;RJ</code> as well.</p>
  
  <p>What can you do please? Thank you for helping. ;-)</p>
  
  <p>Cheers,
  Seb</p>