I am debugging my web site, and I want to switch the target of fwrite() between the current html page and a file. I tried fopen("php://stdout", "w"), but not work.
Is there a way to enable this ? I don't want to change each line of fwrite to echo and change it back when I finish debugging. I am a novice to PHP and didn't find a proper solution after google.
php://output
php://output
is a write-only stream that allows you to write to the output buffer mechanism in the same way asprint()
andecho()
.