@param array $array
@param int   $level
@param bool  $hideHeader

@return string
974388
private function dumpArray(array $array, int $level, bool $hideHeader = false): string
    {
        $indent = $this->style->indent($level);

        if (!$hideHeader) {
            $count = count($array);

            //Array size and scope
            $output = $this->style->apply("array({$count})", 'type', 'array') . "\n";
            $output .= $indent . $this->style->apply('[', 'syntax', '[') . "\n";
        } else {
            $output = '';
        }

        foreach ($array as $key => $value) {
            if (!is_numeric($key)) {
                if (is_string($key)) {
                    $key = htmlspecialchars($key);
                }

                $key = "'{$key}'";
            }

            $output .= $this->dumpValue($value, "[{$key}]", $level + 1);
        }

        if (!$hideHeader) {
            //Closing array scope
            $output .= $indent . $this->style->apply(']', 'syntax', ']') . "\n";
        }

        return $output;
    }
375999
protected function setHeadingIds( &$content, $level = 1 ){
		foreach( $this->headings as $heading ){														//  
			$find		= "/<h".$heading->level."(.*)>".$heading->label."/";						//  
			$replace	= '<h'.$heading->level.'\\1 id="'.$heading->id.'">'.$heading->label;		//  
			$content	= preg_replace( $find, $replace, $content );								//  
		}
		return $content;
	}
99589
private function dumpObject(
        $object,
        int $level,
        bool $hideHeader = false,
        string $class = ''
    ): string {
        $indent = $this->style->indent($level);

        if (!$hideHeader) {
            $type = ($class ?: get_class($object)) . ' object ';

            $header = $this->style->apply($type, 'type', 'object') . "\n";
            $header .= $indent . $this->style->apply('(', 'syntax', '(') . "\n";
        } else {
            $header = '';
        }

        //Let's use method specifically created for dumping
        if (method_exists($object, '__debugInfo') || $object instanceof \Closure) {
            if ($object instanceof \Closure) {
                $debugInfo = $this->describeClosure($object);
            } else {
                $debugInfo = $object->__debugInfo();
            }

            if (is_array($debugInfo)) {
                //Pretty view
                $debugInfo = (object)$debugInfo;
            }

            if (is_object($debugInfo)) {
                //We are not including syntax elements here
                return $this->dumpObject($debugInfo, $level, false, get_class($object));
            }

            return $header
                . $this->dumpValue($debugInfo, '', $level + (is_scalar($object)), true)
                . $indent . $this->style->apply(')', 'syntax', ')') . "\n";
        }

        $refection = new \ReflectionObject($object);

        $output = '';
        foreach ($refection->getProperties() as $property) {
            $output .= $this->dumpProperty($object, $property, $level);
        }

        //Header, content, footer
        return $header . $output . $indent . $this->style->apply(')', 'syntax', ')') . "\n";
    }
1027580
public static function dot($array, $assocOnly = false, $depth = null, $separator = null)
	{
		return static::level($array, $assocOnly, $depth, $separator);
	}
417930
function TraverseXMLize($array, $arrName = "array", $level = 0) {
		if ($level == 0) {
			echo "<pre>";
		}

		while (list($key, $val) = @each($array)) {
			if (is_array($val)) {
				$this->TraverseXMLize($val, $arrName . "[" . $key . "]", $level + 1);
			} else {
				echo '$' . $arrName . '[' . $key . '] = "' . $val . "\"\n";
			}
		}

		if ($level == 0) {
			echo "</pre>";
		}
	}
1091509
protected function getLevelName($level)
    {
        return in_array($level, self::$levels) ? array_search($level, self::$levels) : '--';
    }
1181280
public static function get($array, $key, $default = null) {
        $keys = explode(".", $key);
        $level = &$array;
        $length = count($keys);
        foreach($keys as $index => $key) {
            if (!is_array($level)) {
              return null;
            }

            if(array_key_exists($key, $level)) {
                if($index == $length-1) {
                    return $level[$key];
                } else {
                    $level = &$level[$key];
                }
            } else {
                return $default;
            }
        }
        return $default;
    }
889599
private function string_from_array(array $array) {
		$retval = "";
		foreach($array as $index) {
			if(strlen($retval)) {
				$retval .= "/". $index;
			}
			else {
				$retval = $index;
			}
		}
		return($retval);
	}
939166
public static function implode($array, $separator = " > ")
    {
        if ($array === null) {
            return "";
        }

        $elements = [];
        foreach($array as $rawElement) {
            $element = self::sanitizeString($rawElement);

            if ($element !== null) {
                $elements[] = $element;
            }
        }

        return implode($separator, $elements);
    }
827183
public function renderNested(array $items, $level = 0)
    {
        $out = '';
        foreach ($items as $item) {
            $out .= $this->_renderItem($item, $level);
        }
        return $out;
    }
310124
protected function packArray(array $array, int $level = 0): string
    {
        if ($array === []) {
            return '[]';
        }
        //Delimiters between rows and sub-arrays.
        $subIndent = "\n" . str_repeat(self::INDENT, $level + 2);
        $keyIndent = "\n" . str_repeat(self::INDENT, $level + 1);
        //No keys for associated array
        $associated = array_diff_key($array, array_keys(array_keys($array)));
        $result = [];
        $innerIndent = 0;
        if (!empty($associated)) {
            foreach ($array as $key => $value) {
                //Based on biggest key length
                $innerIndent = max(strlen(var_export($key, true)), $innerIndent);
            }
        }
        foreach ($array as $key => $value) {
            $prefix = '';
            if (!empty($associated)) {
                //Key prefix
                $prefix = str_pad(
                        var_export($key, true),
                        $innerIndent, ' ',
                        STR_PAD_RIGHT
                    ) . " => ";
            }
            if (!is_array($value)) {
                $result[] = $prefix . $this->packValue($value);
                continue;
            }
            if ($value === []) {
                $result[] = $prefix . "[]";
                continue;
            }
            $subArray = $this->packArray($value, $level + 1);
            $result[] = $prefix . "[{$subIndent}" . $subArray . "{$keyIndent}]";
        }
        if ($level !== 0) {
            return $result ? join(",{$keyIndent}", $result) : "";
        }

        return "[{$keyIndent}" . join(",{$keyIndent}", $result) . "\n]";
    }
977839
protected function filter(array $array)
    {
        $config = collect(array_dot($array))->map(function ($value, $key) {
            if (str_contains($key, $this->hidden)) {
                return '';
            }

            if (in_array($key, $this->boolean)) {
                return (bool) $value;
            }

            return $value;
        });

        $array = [];
        foreach ($config as $key => $value) {
            array_set($array, $key, $value);
        }

        return $array;
    }
1281186
protected static function convertArrayToString( $array, $breakMode, $level = 1 )
	{
		$list = array();
		foreach( $array as $key => $value )
		{
			$string	= self::convertArgumentToString( $value, $breakMode, $level+1 );
			$list[]	= $key.":".$string;
		}
		$block	= implode( ", ", $list );
		if( $breakMode == 2 )
		{
			$level	= str_repeat( "&nbsp;", 3 * $level );
			$indent	= str_repeat( "&nbsp;", 3 );
			$list	= implode( ",<br/>".$level.$indent.$indent.$indent.$indent, $list );
			$block	= "<br/>".$level.$indent.$indent.$indent.$indent.$list."<br/>".$level.$indent.$indent.$indent;
		}
		if( $breakMode == 3 )
		{
			$block	= self::blockquote( implode( ',<br/>', $list ) );
		}
		return '{'.$block.'}';
	}
1167148
private static function arrayFlatten($array, $depth = INF)
    {
        return array_reduce($array, function ($result, $item) use ($depth) {
            if ($item instanceof CollectionContract) {
                $item = $item->all();
            }
            if (!is_array($item)) {
                return array_merge($result, [$item]);
            }
            else if ($depth === 1) {
                return array_merge($result, array_values($item));
            }
            else {
                return array_merge($result, static::arrayFlatten($item, $depth - 1));
            }
        }, []);
    }
610150
public function pureDump(array $array): string
    {
        $xml = new ArrayToXml(
            $array,
            [
                '_attributes' => $this->options['rootAttr'],
                'rootElementName' => $this->options['root'],
            ],
            $this->options['keySpaceToUnderscore']
        );

        $dom = $xml->toDom();
        $dom->xmlVersion = $this->options['version'];
        $dom->encoding = $this->options['encoding'];
        $dom->formatOutput = !$this->options['minify'];

        return $dom->saveXML();
    }
839498
public static function recursive(array $array, int $level = 1): string
    {
        if ($level === 1) {
            self::$value = '';
        }

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . PHP_EOL;
                self::recursive($value, $level + 1);
            } else {
                self::$value .= str_repeat('-', $level - 1) .
                    (($level - 1 > 0) ? ' ' : '') .
                    $key . ':' . $value . PHP_EOL;
            }
        }

        return self::$value;
    }
882751
public function getMerge($array = [], $pid = 0, $level = 1, $maxLevel = 3){
        $list = [];

        if ($level <= $maxLevel){

            foreach ($array as $v) {
                if ($v[$this->_config['parent']] == $pid) {
                    $v['level'] = $level;
                    $v[$this->_config['child']] = $this->getMerge($array, $v['id'], $level + 1, $maxLevel);
                    $list[]     = $v;
                }
            }
        }

        return $list;
    }