<?php
define('PW_AUTH', '3x1x7MEguZSVIaUVHdBG4XXXXXXXXXXXXXXXXXXXXXXXXXXXxgfHPPAMqmX1VmYH5k6GFYo8n0QdmexUSQRWpvoFYwVACAnG');
define('PW_APPLICATION', '2XXFX-XXx7C');
define('PW_DEBUG', true);
function pwCall($method, $data = array()) {
$url = 'https://cp.pushwoosh.com/json/1.3/' . $method;
$request = json_encode(['request' => $data]);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$response = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
if (defined('PW_DEBUG') && PW_DEBUG) {
print "[PW] request: $request\n";
print "[PW] response: $response\n";
print "[PW] info: " . print_r($info, true);
}
}
pwCall('createMessage', array(
'application' => PW_APPLICATION,
'auth' => PW_AUTH,
'notifications' => array(
array(
'send_date' => 'now',
'content' => 'Send this content to user',
)
),
)
);
?>
PHP is telling me that there is an error
Parse error: syntax error, unexpected '[', expecting ')' in /home/a5047433/public_html/pushtest.php on line 8
how ever when i run it on a php tester it says its ok and worrks as expected any body know what the issue is
I tested this code at http://phpfiddle.org/ and it works as expected
ERROR i am gettting: Parse error: syntax error, unexpected '[', expecting ')' this is on a 000 web host accoount Any help is greatly appreciated thanks