Keep any element from given array that its key is in the given list of keys

array:keep_keys(ARRAY $array, ARRAY $keys) : ARRAY

array:keep_keys(["hello","world"],[0,1])
#=> [ "hello", "world" ]

array:keep_keys(["name" => "foo","email" => "test"],["name"])
#=> [ "name" => "foo" ]

array:keep_keys(["name" => "foo","email" => "test"],[])
#=> []

Copyright ©2013-2022 SunSed®. All rights reserved.