コード例 #1
0
ファイル: helper.php プロジェクト: kenwi/core
 function testRecursiveArraySearch()
 {
     $haystack = array("Foo" => "own", "Bar" => "Cloud");
     $result = OC_Helper::recursiveArraySearch($haystack, "own");
     $expected = "Foo";
     $this->assertEquals($result, $expected);
     $result = OC_Helper::recursiveArraySearch($haystack, "NotFound");
     $this->assertFalse($result);
 }
コード例 #2
0
ファイル: util.php プロジェクト: enoch85/owncloud-testserver
 /**
  * performs a search in a nested array
  *
  * @param array $haystack the array to be searched
  * @param string $needle the search string
  * @param int $index optional, only search this key name
  * @return mixed the key of the matching field, otherwise false
  * @since 4.5.0
  */
 public static function recursiveArraySearch($haystack, $needle, $index = null)
 {
     return \OC_Helper::recursiveArraySearch($haystack, $needle, $index);
 }