Page 1 of 1

writing to console

Posted: Mon Apr 12, 2004 5:58 am
by damithc
which function (if any) should i use to display a message on the screen? I'm running php in command line to generate some text files. if I use 'echo', all the 'echo's in included files go to generated files instead of going to the screen (command console) :? .

Posted: Mon Apr 12, 2004 8:29 am
by Weirdan
Would you mind to post some code?

Posted: Mon Apr 12, 2004 9:01 am
by kettle_drum
Hmmm echo() normally prints to the console fine. Try system('echo "blah"');

Posted: Mon Apr 12, 2004 10:25 am
by damithc
hi weirdan, since this is related to this (posted by me again :wink: ), i explained the situtation there with reference to sample code. Let us continue in that thread pls.

Kettle_drum, tried your suggestion, but no luck. may be the sample code at above mentioned thread could give you some clue...?

Posted: Tue Apr 13, 2004 2:28 pm
by Weirdan

Code: Select all

$fp=fopen("php://stdout","a+");
fwrite($fp, "something");

Posted: Tue Apr 13, 2004 8:08 pm
by damithc
Great! It works. Thanks a lot :D :D :D