original_string: public static function flattenArray($array, $delimiter = '.', $prefix = '') {
          if(!is_array($array)) {
              return $array;
          }
  
          $result = array();
  
          foreach($array as $key => $value) {
              if(is_array($value)) {
                  $result = array_merge($result, self::flattenArray($value, $delimiter, $prefix.$key.$delimiter));
              }
              else {
                  $result[$prefix.$key] = $value;
              }
          }
  
          return $result;
      }
code: public static function flattenArray($array, $delimiter = '.', $prefix = '') {
          if(!is_array($array)) {
              return $array;
          }
  
          $result = array();
  
          foreach($array as $key => $value) {
              if(is_array($value)) {
                  $result = array_merge($result, self::flattenArray($value, $delimiter, $prefix.$key.$delimiter));
              }
              else {
                  $result[$prefix.$key] = $value;
              }
          }
  
          return $result;
      }
code_tokens: public static function flattenArray ( $ array , $ delimiter = '.' , $ prefix = '' ) { if ( ! is_array ( $ array ) ) { return $ array ; } $ result = array ( ) ; foreach ( $ array as $ key => $ value ) { if ( is_array ( $ value ) ) { $ result = array_merge ( $ result , self :: flattenArray ( $ value , $ delimiter , $ prefix . $ key . $ delimiter ) ) ; } else { $ result [ $ prefix . $ key ] = $ value ; } } return $ result ; }
docstring: Flattens an array, preserving keys delimited by a delimiter
  
  @param array $array The array that will be flattened
  @param string $delimiter The used delimiter.
  @param string $prefix Will be added in front of every key
  @return array<mixed> The resulting array
docstring_tokens: Flattens an array preserving keys delimited by a delimiter