title: PUT request with curl in PHP conversion
body: <p>I have to make a PUT request in PHP, in the documentation of the API I have the example:   </p>
  
  <pre><code> curl --request PUT \
        --url 'http://url
        --header 'Content-Type: application/json' \
        --header 'TOKENMM: {{TOKEN}}' \
        --data '[
      {
      "item1": 123,
      "item2": 231,
      "item3": 321
      },
    {
      "item1": 456,
      "item2": 465,
      "item3": 654
    }
  ]'
  </code></pre>
  
  <p>How can I do that request using PHP's curl? I tried some answers to similar questions but with no success.</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>private function getInfoAPI($data_json){
  
          print_r($data_json);
          $url = 'url';
          $authorization = "TOKENMM: token";
  
      $ch = curl_init();
          curl_setopt($ch, CURLOPT_URL, $url);
          curl_setopt($ch, CURLOPT_HTTPHEADER,  ['Content-Type: application/json', $authorization]);
          curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
          curl_setopt($ch, CURLOPT_POSTFIELDS,$data_json);
          curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
          $response  = curl_exec($ch);
          echo curl_error($ch);
          var_dump( curl_getinfo ( $ch ) );
          curl_close($ch);
  
          return $response;
      }
  </code></pre>