How do you slow down the output from a DOS / windows command prompt
Posted
by JW
on Stack Overflow
See other posts from Stack Overflow
or by JW
Published on 2010-04-28T05:13:31Z
Indexed on
2010/04/28
5:33 UTC
Read the original article
Hit count: 266
I have lots of experience of writing php scripts that are run in the context of a webserver and almost no epxerience of writing php scripts for CLI or GUI output.
I have used the command line for linux but do not have much expereince with DOS.
Lets say I have php script that is:
<?php
echo('Hello world');
for ($idx = 0 ; $idx < 100 ; $idx++ )
{
echo 'I am line '. $idx . PHP_EOL;
}
Then, I run it in my DOS Command prompt:
# php helloworld.php
Now this will spurt out the output quckly and i have to scroll the DOS command window up to see the output.
I want to see the output one 'screen full' at a time.
How do you do that from the perspective of a DOS user?
Furthermore, although this is not my main main question, I would be also interested in knowing how to make the php script 'wait for input' from the command prompt.
© Stack Overflow or respective owner