public static function sprint_r($obj)
    {
        ob_start();
        print_r($obj);
        $str = ob_get_contents();
        ob_end_clean();

        $str = preg_replace("/\s+\\(\s+/", " ( ", $str);
        $str = preg_replace("/\n\s+/", ", ", $str);
        $str = preg_replace("/\n\s*\\)/", " )", $str);
        return $str;
    }
public static function sprint_r($obj)
    {
        ob_start();
        print_r($obj);
        $str = ob_get_contents();
        ob_end_clean();

        $str = preg_replace("/\s+\\(\s+/", " ( ", $str);
        $str = preg_replace("/\n\s+/", ", ", $str);
        $str = preg_replace("/\n\s*\\)/", " )", $str);
        return $str;
    }
public static function sprint_r ( $ obj ) { ob_start ( ) ; print_r ( $ obj ) ; $ str = ob_get_contents ( ) ; ob_end_clean ( ) ; $ str = preg_replace ( "/\s+\\(\s+/" , " ( " , $ str ) ; $ str = preg_replace ( "/\n\s+/" , ", " , $ str ) ; $ str = preg_replace ( "/\n\s*\\)/" , " )" , $ str ) ; return $ str ; }
Format an object using print_r, formatting to a singe line object notation
Format an object using print_r formatting to a singe line object notation