Redirecting standard output

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonathan Turkanis

    Redirecting standard output

    Hi,

    I'm using PHP 5 with the command-line interface. I'd like to know if there is a
    way to redirect calls to print and echo temporarily so that they go to an
    arbitrary stream.

    Because I want to be able to control the redirection with the script, using
    shell i/o redirection is not appropriate. I've discovered how to redirect calls
    to fwrite(STDOUT, ...) using filter chains, but I'm hoping to provide a
    user-level interface in which programmers can simply print instead of using
    fwrite and cousins.

    Any help would be greatly appreciated.

    --
    Jonathan Turkanis




  • Chung Leong

    #2
    Re: Redirecting standard output



    Comment

    • Jonathan Turkanis

      #3
      Re: Redirecting standard output

      Chung Leong wrote:[color=blue]
      > http://fi.php.net/ob_start/[/color]

      Thanks!

      --
      Jonathan Turkanis




      Comment

      Working...