For sending a user a Boxcar notification, I use this example:
curl_setopt_array(
$chpush = curl_init(),
array(
CURLOPT_URL => "https://new.boxcar.io/api/notifications",
CURLOPT_POSTFIELDS => array(
"user_credentials" => 'ACCESS_TOKEN',
"notification[title]" => 'message title',
"notification[long_message]" => '<b>Some text or HTML for the full layout page notification</b>',
"notification[sound]" => "bird-1",
)));
$ret = curl_exec($chpush);
curl_close($chpush);
But I get some output on my page, which is probably the response of the Boxcar server. How can I prevent that output from being printed?
I already found the solution:
Set
CURLOPT_RETURNTRANSFER
toTRUE
. See this StackOverflow Answer for more information. For future reference, to send the user a Boxcar notification, you could also use: