XBRL-Report-Base.php
private function flatten( $input, $depth = 0, $startIndex = 0 )
	{
		$result = array();

		if ( ! is_array( $input ) ) return $result;

		foreach ( $input as $key => $item )
		{
			if ( is_array( $item ) )
			{
				$x = $this->flatten( $item, $depth + 1, $startIndex );
				$result = $result + $x;
				$startIndex += count( $x );
			}
			else
			{
				$result[ $startIndex ] = str_repeat( "\t", $depth ) . $item;
				$startIndex++;
			}
		}

		return $result;
	}
private function flatten( $input, $depth = 0, $startIndex = 0 )
	{
		$result = array();

		if ( ! is_array( $input ) ) return $result;

		foreach ( $input as $key => $item )
		{
			if ( is_array( $item ) )
			{
				$x = $this->flatten( $item, $depth + 1, $startIndex );
				$result = $result + $x;
				$startIndex += count( $x );
			}
			else
			{
				$result[ $startIndex ] = str_repeat( "\t", $depth ) . $item;
				$startIndex++;
			}
		}

		return $result;
	}
private function flatten ( $ input , $ depth = 0 , $ startIndex = 0 ) { $ result = array ( ) ; if ( ! is_array ( $ input ) ) return $ result ; foreach ( $ input as $ key => $ item ) { if ( is_array ( $ item ) ) { $ x = $ this -> flatten ( $ item , $ depth + 1 , $ startIndex ) ; $ result = $ result + $ x ; $ startIndex += count ( $ x ) ; } else { $ result [ $ startIndex ] = str_repeat ( "\t" , $ depth ) . $ item ; $ startIndex ++ ; } } return $ result ; }
Flatten an array of mixed values and arrays

@param array $input			An array containing text and arrays to be flattened with indentation
@param number $depth			The depth of the recursion.  Used to determine the number of tabs to add.
@param number $startIndex	Value of the first index to use when adding
strings to the flattened array to prevent keys
overlapping so they can be joined.
@return array A flat array of values.
Flatten an array of mixed values and arrays