Code:
// Init Connection
$ch=curl_init(cURL);
if (!$ch){
die(sprintf('Error [%d]:
%s',curl_errno($ch),curl_error($ch)));
}
//Set Message options
curl_setopt($ch,CURLOPT_POST,1);
//Set this option to a non-zero value if you want PHP to do a
regular HTTP
POST.
curl_setopt($ch,CURLOPT_POSTFIELDS,$msg); //Pass a
string containing the full data to post in an HTTP "POST"
operation.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Pass a non-zero
value if you want CURL to directly return the transfer instead
of printing
it out directly.
// Execute Command and close connection
$output = curl_exec($ch);
$succeeded = curl_errno($ch) == 0 ? true : false;
curl_close($ch);