For this PHP code exercise, create a file named array_search_keys.php
. This file should contain a function named array_search_keys()
which accepts two parameters. The first parameter must be an array. The second parameter is an optional string.
array_search_keys()
is very similar to the array_keys()
in PHP. However, instead of the second parameter matching against the input values, array_search_keys()
should match against the input keys.
Note: for this exercise, you can assume that all keys within the given array are strings.
Review the PHP Code Exercises documentation for more details on performing code exercises.
Jump on the PHP channel in Slack and ask your fellow students and mentors for a hint.