3 Replies - 544 Views - Last Post: 01 August 2012 - 06:41 PM Rate Topic: -----

#1 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

where does the standard output in wordpress go?

Posted 01 August 2012 - 05:57 PM

in wordpress php code, something like
function fn(){
....
echo ' value = '.$variable;
...
}

sometimes, the echo shows, sometimes it doesn't, which i guess depending on where the code is.

how can I standard out a variable value? or where can I find my standard out?

thanks
Is This A Good Question/Topic? 0
  • +

Replies To: where does the standard output in wordpress go?

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: where does the standard output in wordpress go?

Posted 01 August 2012 - 06:17 PM

Anything you echo from PHP is sent to the output buffer and, unless intercepted, is sent to the browser, or the CLI stdout stream if executed via a CLI. You can intercept any output by using the Output Control functions. (This can be set to be enabled by default, via the output_buffering ini directive.)

In a CLI script, you can use the same streams you would use in most other languages. PHP defines them for you as constants: STDIN, STDOUT, STDERR. Read more about that here:
http://php.net/manua....io-streams.php
Was This Post Helpful? 0
  • +
  • -

#3 g37752  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 195
  • Joined: 24-July 12

Re: where does the standard output in wordpress go?

Posted 01 August 2012 - 06:19 PM

i put
ob_end_flush();
right before the echo statement, and still gets nothing?
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3710
  • View blog
  • Posts: 5,958
  • Joined: 08-June 10

Re: where does the standard output in wordpress go?

Posted 01 August 2012 - 06:41 PM

Are you sure the code is actually executing that function? Do you have error reporting enabled?

You wouldn't happen to have a debugger set up, so you can set breakpoints?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1