Better written using array_search()