diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2012-07-24 10:54:56 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2012-07-25 12:56:08 +0200 |
commit | 6b320a260434712d8c558bee431dd40af58883ad (patch) | |
tree | df4426d62bf91e4a79464f93a04658269deeb95e /lib/public/util.php | |
parent | 42492338fc708a09ada3d4ef6f4cc8aa0c670ee3 (diff) | |
download | nextcloud-server-6b320a260434712d8c558bee431dd40af58883ad.tar.gz nextcloud-server-6b320a260434712d8c558bee431dd40af58883ad.zip |
provide recursiveArraySearch as Helper function and make available through API
Diffstat (limited to 'lib/public/util.php')
-rw-r--r-- | lib/public/util.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/public/util.php b/lib/public/util.php index 43f9e3cee5d..75ca29f7129 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -320,4 +320,15 @@ class Util { public static function mb_str_replace($search, $replace, $subject, $encoding = 'UTF-8', &$count = null) { return(\OC_Helper::mb_str_replace($search, $replace, $subject, $encoding, $count)); } + + /** + * @brief performs a search in a nested array + * @param haystack the array to be searched + * @param needle the search string + * @param $index optional, only search this key name + * @return the key of the matching field, otherwise false + */ + public static function recursiveArraySearch($haystack, $needle, $index = null) { + return(\OC_Helper::recursiveArraySearch($haystack, $needle, $index)); + } } |