Created
April 16, 2019 18:32
-
-
Save susanBuck/cd2b6c49d8ff3bf4f1b2cc9349f4db65 to your computer and use it in GitHub Desktop.
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
<?php | |
getAlbum(Array $albums, Int $year, String $searchType) { | |
$results = []; | |
# Filter album list according to year | |
foreach ($albums as $key => $album) { | |
$match = $year == $album['year']; | |
if ($match) { | |
$results[$album['position'] . '-' . $album[$searchType]] = $album; | |
} | |
} | |
return $results; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment