using output buffering

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Braun

    #1

    using output buffering

    hi folks,

    this piece of code should not display anything:

    ob_start();
    print_r($users) ;
    ob_end_clean;


    well, for me it does - does anyone know why? in fact, it looks like the
    ob_xxx() commands are simply ignored except for ob_get_contents () which
    works fine.

    output_bufferin g is off in php.ini, but that should not make a
    difference if I have understood the manual correctly.

    I am using PHP 4.3.8 on a debian box w/ apache 1.3.33-3 running PHP as a
    module.

    thanks in advance...

    martin
    --
    For email contact please mail to:
    mail (at) mbant dot de
  • Chris Hope

    #2
    Re: using output buffering

    Martin Braun wrote:
    [color=blue]
    > hi folks,
    >
    > this piece of code should not display anything:
    >
    > ob_start();
    > print_r($users) ;
    > ob_end_clean;
    >
    > well, for me it does - does anyone know why? in fact, it looks like
    > the ob_xxx() commands are simply ignored except for ob_get_contents ()
    > which works fine.[/color]

    Don't forget the parentheses to make it a function call:
    ob_end_clean();

    Add those and it will work fine.

    --
    Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/

    Comment

    • Michael Fesser

      #3
      Re: using output buffering

      .oO(Martin Braun)
      [color=blue]
      >this piece of code should not display anything:
      >
      >ob_start();
      >print_r($users );
      >ob_end_clean ;
      >
      >well, for me it does - does anyone know why?[/color]

      Yep. You should set error_reporting to E_ALL in your php.ini ...

      Micha

      Comment

      • Martin Braun

        #4
        Re: using output buffering

        Chris Hope wrote:[color=blue]
        > Don't forget the parentheses to make it a function call:
        > ob_end_clean();[/color]

        er... yep, you're right! sorry for wasting your time :)

        g
        mb

        --
        For email contact please mail to:
        mail (at) mbant dot de

        Comment

        Working...