title: How to "POST" the JSON data form Salesforce to the external URL of php and fetch into Php
body: <pre><code>public with sharing class Util{
  
      @future (callout=true)
      public static void callWebservice(SET&lt;Id&gt; cont){       
  
          List&lt;Contact&gt; contacts = [SELECT Id, LastName, FirstName FROM Contact WHERE Id = :cont];
  
          String jsonOrders = JSON.serialize(contacts);
  
          // debugging call, which you can check in debug logs
          System.debug('jsonOrders: ' + jsonOrders);
          // create an HTTPrequest object
  
          HttpRequest req = new HttpRequest();
  
          // set up the HTTP request with a method, endpoint, header, and body      
          req.setMethod('POST');  
          req.setEndpoint('//xyz.com/mastercopytest/salesforce/salesforce_cron.php');
          req.setHeader('Content-Type', 'application/json');
  
          req.setBody(jsonOrders);    
          // create a new HTTP object
          Http http = new Http();
  
          System.debug('Request Data '+ req);
  
          // create a new HTTP response for receiving the remote response      
          HTTPResponse res = http.send(req);
  
          // debugging call, which you can check in debug logs
           System.debug('Fulfillment service returned '+ res.getBody());
  
  
           System.debug('getStatusCode '+ res.getStatusCode());
  
          // If status code != 200, write debugging information, done
          if (res.getStatusCode() != 200) {
              System.debug('Error from ' + req.getEndpoint() + ' : ' + res.getStatusCode() + ' ' + res.getStatus());
          }        
  
      }
  } 
  </code></pre>
  
  <p>Now I want to fetch the posted JSON data in php.I am unable to fetch the data from php. Is there anything i am missing here?How to read post JSON data in php. It is showing empty array on php.Please Help me.</p>