0
I have a following problem:
function send_notification(){
$jsonArray = json_decode($result);
$cont_sucesso += $jsonArray->success;
$cont_falha += $jsonArray->failure;
}
for ($i = 0; $i < $num / 1000; $i++) {
$Status = send_notification();
.....
}
console.log($cont_sucesso);
echo("Total SUCESSO: ".$cont_sucesso);
echo("</br>");
echo("Total FALHAS: " .$cont_falha);
echo("</br>");
echo "Total de mensagens enviadas: ".$cont;
I can’t add up the value of $jsonArray->success;
I have a loop and inside that loop I call function that returns jsonArray
But I need to add his comeback to display at the end of the loop, where I’m missing?
Edit: Json
{"multicast_id":5985558851077455261,"success":254,"failure":746,"canonical_ids":0,"results":[{"error":"NotRegistered"},{"message_id":"0:1478517570268212%f17b55e1f9fd7ecd"}]}
Post the json you are using
– Bartolomeu S. Gusella
my json is right, because if I put echo($jsonArray->Success); it shows me the amount
– William
Zica is in these 2 variables $cont_success and $cont_failure. To almost playing in the session and rescuing later.
– William
Is giving some PHP error or simply does not calculate?
– Bartolomeu S. Gusella
it does not add up, no error
– William