<?php

	function sendPush($payload = null) {
	    
	    if (isset($payload) && !empty($payload)) {
	        
	        $url = "https://api.mindbrackets.com/sjm/sendPush";
	        $headers = array('Content-Type: application/json');
	        
	        $ch = curl_init();
	        
	        // Set the url, number of POST vars, POST data
	        curl_setopt($ch, CURLOPT_URL, $url);
	        curl_setopt($ch, CURLOPT_POST, true);
	        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
	        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	     
	        // Disabling SSL Certificate support temporarly
	        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	        
	        curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
	     
	        // Execute post
	        $result = curl_exec($ch);
	        if ($result === FALSE) {
	            die('Curl failed: ' . curl_error($ch));
	        }
	     
	        // Close connection
	        curl_close($ch);
	
	        return $result;
        }
    }
    
    
 
    

?>