How do you slow down the output from a DOS / windows command prompt
- by JW
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.