<?php
'titulo' => 'Bleach',
'resumo' => 'xxx',
'categoria' => 'Ação, Comédia...'
),
'titulo' => 'Titulo livro 2',
'resumo' => 'xxx',
'categoria' => 'Ação, Psicológico, Romance ...'
),
'titulo' => 'Titulo do livro 3',
'resumo' => 'xxx',
'categoria' => 'Romance'
)
);
$search = 'Romance';
$livros,
function ($value) use ($search) {
return (strpos($value['categoria'], $search) !== false); }
)
);
PD9waHAKCiRsaXZyb3MgPSBhcnJheSgKICAgICdMaXZybyAxJyA9PiBhcnJheSAoCiAgICAgICAgJ3RpdHVsbycgPT4gJ0JsZWFjaCcsCiAgICAgICAgJ3Jlc3VtbycgPT4gJ3h4eCcsCiAgICAgICAgJ2NhdGVnb3JpYScgPT4gJ0HDp8OjbywgQ29tw6lkaWEuLi4nCiAgICApLAogICAgJ0xpdnJvIDInID0+IGFycmF5ICgKICAgICAgICAndGl0dWxvJyA9PiAnVGl0dWxvIGxpdnJvIDInLAogICAgICAgICdyZXN1bW8nID0+ICd4eHgnLAogICAgICAgICdjYXRlZ29yaWEnID0+ICdBw6fDo28sIFBzaWNvbMOzZ2ljbywgUm9tYW5jZSAuLi4nCiAgICApLAogICAgJ0xpdnJvIDMnID0+IGFycmF5ICgKICAgICAgICAndGl0dWxvJyA9PiAnVGl0dWxvIGRvIGxpdnJvIDMnLAogICAgICAgICdyZXN1bW8nID0+ICd4eHgnLAogICAgICAgICdjYXRlZ29yaWEnID0+ICdSb21hbmNlJwogICAgKQopOwoKJHNlYXJjaCA9ICdSb21hbmNlJzsKJHJvbWFuY2VzID0gYXJyYXlfa2V5cygKICAgIGFycmF5X2ZpbHRlcigKICAgICAgICAkbGl2cm9zLAogICAgICAgIGZ1bmN0aW9uICgkdmFsdWUpIHVzZSAoJHNlYXJjaCkgewogICAgICAgICAgICByZXR1cm4gKHN0cnBvcygkdmFsdWVbJ2NhdGVnb3JpYSddLCAkc2VhcmNoKSAhPT0gZmFsc2UpOwogICAgICAgIH0KICAgICkKKTsKCnByaW50X3IoJHJvbWFuY2VzKTs=