Reputation: 237
I start coding php-cli script for manipulation with hosts and VirtualHost files in linux.
https://github.com/ErgallM/deep all program
In https://github.com/ErgallM/deep/blob/master/library/Host.php#L34 printing hosts element.
How to less php output?
Upvotes: 0
Views: 123
Reputation: 48357
A quick hack would be to prefix your code with....
<?php
$reentry='reenteredxx123';
if ($argv[1]!=$reentry) {
$script=aray_shift($argv);
$clean=array_map('escapeshellarg',$argv);
$cmd="php $script $reentry" . implode(' ',$clean) . ' | less';
system($cmd);
exit;
} else {
unset($argv[1]);
}
Upvotes: 1
Reputation: 29975
You can do fgets() on STDIN file after you output like 30 lines. This will cause user to wait.
Upvotes: 1