original_string: public function arraySearch($needle, $haystack)
      {
          if (empty($needle) || empty($haystack)) {
              return false;
          }
  
          foreach ($haystack as $key => $value) {
              $exists = 0;
              foreach ($needle as $nkey => $nvalue) {
                  if (!empty($value[$nkey]) && $value[$nkey] === $nvalue) {
                      $exists = 1;
                  } else {
                      $exists = 0;
                  }
              }
  
              if ($exists) {
                  return $key;
              }
          }
  
          return false;
      }
code: public function arraySearch($needle, $haystack)
      {
          if (empty($needle) || empty($haystack)) {
              return false;
          }
  
          foreach ($haystack as $key => $value) {
              $exists = 0;
              foreach ($needle as $nkey => $nvalue) {
                  if (!empty($value[$nkey]) && $value[$nkey] === $nvalue) {
                      $exists = 1;
                  } else {
                      $exists = 0;
                  }
              }
  
              if ($exists) {
                  return $key;
              }
          }
  
          return false;
      }
code_tokens: public function arraySearch ( $ needle , $ haystack ) { if ( empty ( $ needle ) || empty ( $ haystack ) ) { return false ; } foreach ( $ haystack as $ key => $ value ) { $ exists = 0 ; foreach ( $ needle as $ nkey => $ nvalue ) { if ( ! empty ( $ value [ $ nkey ] ) && $ value [ $ nkey ] === $ nvalue ) { $ exists = 1 ; } else { $ exists = 0 ; } } if ( $ exists ) { return $ key ; } } return false ; }
docstring: Search in multidimensional array and return key.
  
  @param array $needle   the searched data
  @param array $haystack the array to search in
  
  @return bool|int
docstring_tokens: Search in multidimensional array and return key .