writing to console

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
damithc
Forum Newbie
Posts: 22
Joined: Sat Apr 10, 2004 12:18 am
Location: singapore
Contact:

writing to console

Post 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) :? .
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Would you mind to post some code?
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Hmmm echo() normally prints to the console fine. Try system('echo "blah"');
User avatar
damithc
Forum Newbie
Posts: 22
Joined: Sat Apr 10, 2004 12:18 am
Location: singapore
Contact:

Post 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...?
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Code: Select all

$fp=fopen("php://stdout","a+");
fwrite($fp, "something");
User avatar
damithc
Forum Newbie
Posts: 22
Joined: Sat Apr 10, 2004 12:18 am
Location: singapore
Contact:

Post by damithc »

Great! It works. Thanks a lot :D :D :D
Post Reply