Send PHP CURL Request
$url = 'http://www.test.com';
$ch = curl_init();
$user_data = array();
$user_data['first_name']=$first_name;
$user_data['last_name']=$last_name;
$user_data['mobile_number']=$mob_phone;
$user_datax = json_encode($user_data);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $user_datax);
curl_setopt($ch, CURLOPT_POST, 1);
$headers = array();
$headers[] = 'Content-Type: application/json';
$headers[] = 'Host: test.sample.com'; // only host name
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
if (curl_errno($ch)) {
// echo 'Error:' . curl_error($ch);
}
curl_close($ch);