Inflector.php
public static function dumperGet(&$variable, $spacing = "") {
        if (is_array($variable)) {
            $type = "Array[" . count( $variable ) . "]";
        } elseif( is_object( $variable ) ) {
            ob_start();
            print_r($variable);
            return ob_get_clean();

        } elseif( gettype( $variable ) == "boolean" ) {
            return $variable ? "true" : "false";
        } elseif( is_null( $variable ) ) {
            return "NULL";
        } else {
            ob_start();
            var_dump($variable);
            return ob_get_clean();
        }
        $buf = $type;
        $spacing .= "    ";
        for (reset( $variable ); list ( $k, $v ) = each( $variable );) {
            if ($k === "GLOBALS" )
                continue;
            $buf .= "\n".$spacing.'['.$k.'] => ' . self::dumperGet( $v, $spacing);
        }

        return $buf;
    }
public static function dumperGet(&$variable, $spacing = "") {
        if (is_array($variable)) {
            $type = "Array[" . count( $variable ) . "]";
        } elseif( is_object( $variable ) ) {
            ob_start();
            print_r($variable);
            return ob_get_clean();

        } elseif( gettype( $variable ) == "boolean" ) {
            return $variable ? "true" : "false";
        } elseif( is_null( $variable ) ) {
            return "NULL";
        } else {
            ob_start();
            var_dump($variable);
            return ob_get_clean();
        }
        $buf = $type;
        $spacing .= "    ";
        for (reset( $variable ); list ( $k, $v ) = each( $variable );) {
            if ($k === "GLOBALS" )
                continue;
            $buf .= "\n".$spacing.'['.$k.'] => ' . self::dumperGet( $v, $spacing);
        }

        return $buf;
    }
public static function dumperGet ( & $ variable , $ spacing = "" ) { if ( is_array ( $ variable ) ) { $ type = "Array[" . count ( $ variable ) . "]" ; } elseif ( is_object ( $ variable ) ) { ob_start ( ) ; print_r ( $ variable ) ; return ob_get_clean ( ) ; } elseif ( gettype ( $ variable ) == "boolean" ) { return $ variable ? "true" : "false" ; } elseif ( is_null ( $ variable ) ) { return "NULL" ; } else { ob_start ( ) ; var_dump ( $ variable ) ; return ob_get_clean ( ) ; } $ buf = $ type ; $ spacing .= "    " ; for ( reset ( $ variable ) ; list ( $ k , $ v ) = each ( $ variable ) ; ) { if ( $ k === "GLOBALS" ) continue ; $ buf .= "\n" . $ spacing . '[' . $ k . '] => ' . self :: dumperGet ( $ v , $ spacing ) ; } return $ buf ; }
Using for beautify output
@param $variable
@param string $spacing
@return string
Using for beautify output