Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php $data = array( 'title'=>"Alia Bhatt", 'message'=>"Sweet Heart", ..
Decoded Output download
<?php
$data = array(
'title'=>"Alia Bhatt",
'message'=>"Sweet Heart",
'color'=>"#0000ff",
'summary'=>"I like you sweet heart",
'bigText'=>"I really like you Alia bhat",
'notificationId'=>"139",
'bigAllowIcon'=>"1",
'bigIconUrl' => "https://img.timesnownews.com/story/1551004158-Untitled_design_14_3.jpg?d=400x400",
'url'=>"https://wikifamous.com/wp-content/uploads/2018/11/Alia-Bhatt-Wallpaper-1000x630.jpg?x50236",
'type'=>"1");
// transfer data to FCM SERVER
$target=["fD_f0xlKRwa8Y8zU6RCcnz:APA91bHIAMeKMN54U3Pl0Why0YmvN__5Yso4HLZNNHT2pdenc4tqrPJQYkeNhp5U296z2A8sKk_08HljFklpZtAIHhzexB9yr6GCKWHz1AC3wCoeXR22uzQY0_p0Wr9fyatkcuuCKdit"];
$url = 'https://fcm.googleapis.com/fcm/send';
//api_key available in Firebase Console -> Project Settings -> CLOUD
$server_key = 'AAAAVuUc9R4:APA91bFslSr-3NRFvcjqEAlfjHIarufADe5NxHL8W0_eWIfjrc4o3MEBJtxi0QIF7r0NPIuNnOueVCjxL5YafEipBBAXgF5Yk3NzPJDfm3kjoALcIKLFHfWBSY-hIv1sm7sFwSA9UXbJ';
$fields = array();
if(is_array($target)){
$fields['registration_ids'] = $target;
}else{
$fields['to'] = $target;
}
$fields['data'] = $data;
//header with content_type api key
$headers = array(
'Content-Type:application/json',
'Authorization:key='.$server_key
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
//echo json_encode($fields);
$result = curl_exec($ch);
curl_close($ch);
if ($result === FALSE)
{
$fail["status"]=false;
$fail["message"]="no data found operation";
echo $result;
}
else
{
echo $result;
$success["status"]=true;
$success["message"]="response attached to data";
$success["data"]=json_decode($result);
}
?>
Did this file decode correctly?
Original Code
<?php
$data = array(
'title'=>"Alia Bhatt",
'message'=>"Sweet Heart",
'color'=>"#0000ff",
'summary'=>"I like you sweet heart",
'bigText'=>"I really like you Alia bhat",
'notificationId'=>"139",
'bigAllowIcon'=>"1",
'bigIconUrl' => "https://img.timesnownews.com/story/1551004158-Untitled_design_14_3.jpg?d=400x400",
'url'=>"https://wikifamous.com/wp-content/uploads/2018/11/Alia-Bhatt-Wallpaper-1000x630.jpg?x50236",
'type'=>"1");
// transfer data to FCM SERVER
$target=["fD_f0xlKRwa8Y8zU6RCcnz:APA91bHIAMeKMN54U3Pl0Why0YmvN__5Yso4HLZNNHT2pdenc4tqrPJQYkeNhp5U296z2A8sKk_08HljFklpZtAIHhzexB9yr6GCKWHz1AC3wCoeXR22uzQY0_p0Wr9fyatkcuuCKdit"];
$url = 'https://fcm.googleapis.com/fcm/send';
//api_key available in Firebase Console -> Project Settings -> CLOUD
$server_key = 'AAAAVuUc9R4:APA91bFslSr-3NRFvcjqEAlfjHIarufADe5NxHL8W0_eWIfjrc4o3MEBJtxi0QIF7r0NPIuNnOueVCjxL5YafEipBBAXgF5Yk3NzPJDfm3kjoALcIKLFHfWBSY-hIv1sm7sFwSA9UXbJ';
$fields = array();
if(is_array($target)){
$fields['registration_ids'] = $target;
}else{
$fields['to'] = $target;
}
$fields['data'] = $data;
//header with content_type api key
$headers = array(
'Content-Type:application/json',
'Authorization:key='.$server_key
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
//echo json_encode($fields);
$result = curl_exec($ch);
curl_close($ch);
if ($result === FALSE)
{
$fail["status"]=false;
$fail["message"]="no data found operation";
echo $result;
}
else
{
echo $result;
$success["status"]=true;
$success["message"]="response attached to data";
$success["data"]=json_decode($result);
}
?>
Function Calls
None |
Stats
MD5 | c295c86ccfa41ab1b88d8a1fdcd835ad |
Eval Count | 0 |
Decode Time | 74 ms |