Created
November 17, 2019 19:08
-
-
Save maagmirror/2c4ad3ad58e2c26bfac74977f0685ce5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$json = '[{"clientcoupon":"JR1VU","clientname":"joaquin inventado","clientemail":"[email protected]","clientpet":"Raza Pequena","userpetquantity":"2","refugee":"Adopciones-Quilmes","clientphone":"8888888"}, {"clientcoupon":"JR1VU","clientname":"joaquin inventado","clientemail":"[email protected]","clientpet":"Raza Pequena","userpetquantity":"2","refugee":"Adopciones-Lanus","clientphone":"8888888"}, {"clientcoupon":"JR1VU","clientname":"joaquin inventado","clientemail":"[email protected]","clientpet":"Raza Pequena","userpetquantity":"2","refugee":"Adopciones-Bera","clientphone":"8888888"}, {"clientcoupon":"JR1VU","clientname":"joaquin inventado","clientemail":"[email protected]","clientpet":"Raza Pequena","userpetquantity":"2","refugee":"Adopciones-Bera","clientphone":"8888888"}]'; | |
$resultados_parseados = json_decode($json); | |
$refugios = []; | |
foreach ($resultados_parseados as $cliente) { | |
$refugios[] = $cliente->refugee; | |
} | |
$resultados_refugee = array_count_values($refugios); | |
var_dump($refugios); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment