Created
May 11, 2018 12:14
-
-
Save acwoss/2029f80546b5ad6bdd73179b1348dac1 to your computer and use it in GitHub Desktop.
DutifulIntentionalAdvance created by acwoss - https://repl.it/@acwoss/DutifulIntentionalAdvance
This file contains 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
$json = <<<JSON | |
[ | |
{ | |
"id": "1", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-09-05", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "8", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-10-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "15", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-11-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "16", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-11-03", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "17", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-11-03", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "24", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2017-12-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "31", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2018-01-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "40", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2018-02-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "47", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2018-03-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "60", | |
"clientid": "1", | |
"status": "2", | |
"duedate": "2018-04-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "61", | |
"clientid": "1", | |
"status": "4", | |
"duedate": "2018-05-06", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
}, | |
{ | |
"id": "68", | |
"clientid": "1", | |
"status": "4", | |
"duedate": "2018-05-03", | |
"company": "Cliente Exemplo", | |
"website": "clienteexemplo.com" | |
} | |
] | |
JSON; | |
abstract class Status { | |
const ATRASADO = 4; | |
const EM_DIA = 2; | |
} | |
$data = json_decode($json); | |
$atrasados = array_filter($data, function ($it) { | |
return $it->status == Status::ATRASADO; | |
}); | |
print_r($atrasados); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment