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
where does the standard output in wordpress go?
Page 1 of 13 Replies - 281 Views - Last Post: 01 August 2012 - 06:41 PM
Replies To: where does the standard output in wordpress go?
#2
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
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
#3
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?
ob_end_flush();
right before the echo statement, and still gets nothing?
#4
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?
You wouldn't happen to have a debugger set up, so you can set breakpoints?
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|