Skip to content

Instantly share code, notes, and snippets.

View aran112000's full-sized avatar

Aran Reeks aran112000

View GitHub Profile
@aran112000
aran112000 / array_ksearch.php
Last active August 28, 2019 10:02
Search a PHP array for a matching key - array_ksearch(), array_kisearch()
<?php
/**
* Search an array recursively looking for a key containing the supplied $search_string
*
* array_ksearch() is case-sensitive, where as array_kisearch() is case-insensitive
*
* Returns an array containing all matched key(s) and their associated value(s), or an empty array upon no matches
*
* @param array $array