title: How can I convert data from POSTMAN into PHP Curl Request?
body: <p>I have an API in postman. I want to create a CURL Request and get proper response with it. This is my POSTMAN API.</p>
  
  <p><a href="https://i.stack.imgur.com/3VkNm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/3VkNm.png" alt="enter image description here"></a></p>
  
  <p>I am successfully getting this response with it.</p>
  
  <pre><code>"{\"Request\":{\"state\":\"Manama\",\"address\":\"406 Falcon Tower\",\"address2\":\"Diplomatic Area\",\"city\":\"Manama\",\"country\":\"BH\",\"fullname\":\"Dawar Khan\",\"postal\":\"317\"},\"Response\":{\"status\":\"Success\",\"code\":100,\"message\":\"Address is verified\"}}"
  </code></pre>
  
  <p>Now I want to use this API Call inside my PHP Code. I used this code.</p>
  
  <pre><code>    $data = array(
          'Request' =&gt; 'ValidateAddress',
          'address' =&gt; test_input($form_data-&gt;address),
          'secondAddress' =&gt; test_input($form_data-&gt;secondAddress),
          'city' =&gt; test_input($form_data-&gt;city),
          'country' =&gt; test_input($form_data-&gt;country),
          'name' =&gt; test_input($form_data-&gt;name),
          'zipCode' =&gt; test_input($form_data-&gt;zipCode),
          'merchant_id' =&gt; 'shipm8',
          'hash' =&gt; '09335f393d4155d9334ed61385712999'
      );
      $data_string = json_encode($data);
  
      $url = 'myurl.com/';
  
      $ch = curl_init($url);
      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
      curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
      curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
      curl_setopt($ch, CURLOPT_HTTPHEADER, array(
          'Content-Type: application/json',
          'Content-Length: ' . strlen($data_string))
      );
      $result = curl_exec($ch);
      curl_close($ch);
      $json_result = json_decode($result, true);
      echo '&lt;pre&gt;';print_r($json_result);echo '&lt;/pre&gt;';
  </code></pre>
  
  <p>But I can't see my $json_result. It just echoes <code>&lt;pre&gt;&lt;/pre&gt;</code> in the view. Can anyone guide me? Thanks in advance. I want to get my <code>Response</code>.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I used curl_error and it gives me the following error.</p>
  
  <blockquote>
    <p>Curl error: SSL certificate problem: self signed certificate in certificate chain</p>
  </blockquote>