25 lines
No EOL
745 B
PHP
25 lines
No EOL
745 B
PHP
<?php
|
|
$books = [
|
|
[
|
|
'name' => 'Do Androids Dream of Electric Sheep',
|
|
'author' => 'Philip K. Dick',
|
|
'releaseYear' => 1968,
|
|
'purchaseUrl' =>'http://example.com'
|
|
],
|
|
[
|
|
'name' => 'Projekt Hail Mary',
|
|
'author' => 'Andy Weir',
|
|
'releaseYear' => 2021,
|
|
'purchaseUrl' => 'http://example.com'
|
|
],
|
|
[
|
|
'name' => 'The Martian',
|
|
'author' => 'Andy Weir',
|
|
'releaseYear' => 2011,
|
|
'purchaseUrl' => 'http://example.com'
|
|
]
|
|
];
|
|
$filteredItems = array_filter($books, function($book) {
|
|
return $book['author'] == 'Andy Weir';
|
|
});
|
|
require "index.view.php"; |