<?php
$clientes = [
['id' => 1, 'nome' => 'Alefe', 'valor_autorizado' => 12159.99],
['id' => 2, 'nome' => 'Bete', 'valor_autorizado' => 35122.00],
['id' => 3, 'nome' => 'Guimel', 'valor_autorizado' => 86242.90],
['id' => 4, 'nome' => 'Dalete', 'valor_autorizado' => 2342.31]
];
/* Valor acima de 40.000 */
$clientes_filtrados = array_filter($clientes, function($arr) { return $arr["valor_autorizado"] >= 40000;
});
echo "Valor acima de 40.000<Br>";
/* Nomes que começam com A ou B */
$clientes_filtrados = array_filter($clientes, function($arr) { });
echo "Nomes que começam com A ou B<br>";
PD9waHAKCiRjbGllbnRlcyA9IFsKICAgWydpZCcgPT4gMSwgJ25vbWUnID0+ICdBbGVmZScsICd2YWxvcl9hdXRvcml6YWRvJyA9PiAxMjE1OS45OV0sCiAgIFsnaWQnID0+IDIsICdub21lJyA9PiAnQmV0ZScsICd2YWxvcl9hdXRvcml6YWRvJyA9PiAzNTEyMi4wMF0sCiAgIFsnaWQnID0+IDMsICdub21lJyA9PiAnR3VpbWVsJywgJ3ZhbG9yX2F1dG9yaXphZG8nID0+IDg2MjQyLjkwXSwKICAgWydpZCcgPT4gNCwgJ25vbWUnID0+ICdEYWxldGUnLCAndmFsb3JfYXV0b3JpemFkbycgPT4gMjM0Mi4zMV0KXTsKCi8qIFZhbG9yIGFjaW1hIGRlIDQwLjAwMCAqLwokY2xpZW50ZXNfZmlsdHJhZG9zID0gYXJyYXlfZmlsdGVyKCRjbGllbnRlcywgZnVuY3Rpb24oJGFycikgewogICAgcmV0dXJuICRhcnJbInZhbG9yX2F1dG9yaXphZG8iXSA+PSA0MDAwMDsKfSk7CgplY2hvICJWYWxvciBhY2ltYSBkZSA0MC4wMDA8QnI+IjsKdmFyX2R1bXAoJGNsaWVudGVzX2ZpbHRyYWRvcyk7CgovKiBOb21lcyBxdWUgY29tZcOnYW0gY29tIEEgb3UgQiAqLwokY2xpZW50ZXNfZmlsdHJhZG9zID0gYXJyYXlfZmlsdGVyKCRjbGllbnRlcywgZnVuY3Rpb24oJGFycikgewogICAgcmV0dXJuIHByZWdfbWF0Y2goIi9eW0FCXS8iLCAkYXJyWyJub21lIl0pOwp9KTsKCmVjaG8gIk5vbWVzIHF1ZSBjb21lw6dhbSBjb20gQSBvdSBCPGJyPiI7CnZhcl9kdW1wKCRjbGllbnRlc19maWx0cmFkb3MpOw==