Here is the trick, in your script use:
system("clear");
To make it work on both Windows and Linux:
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') system("cls"); else system("clear");
I hope this helps someone.
Call our support 24/7 0800-123-4567
Here is the trick, in your script use:
system("clear");
To make it work on both Windows and Linux:
if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') system("cls"); else system("clear");
I hope this helps someone.
How to clean the screen with PHP in Linux (cls, Linux, PHP)
Please please please don’t do that
.
for ($i = 0; $i < ; $i++) { print “\n”; }
Is way more portable.
I know it’s not common, but some people will be running PHP on windows.
Comment
William, thanks for your comment but with all respect I disagree…
The code I posted can check for the platform and use “cls” or “clear” and your code won’t produce the desired effect for me.
Comment
Unfortunately neither of these solutions work on Windows 7. I have yet to find a viable solution to clearing the terminal from within a PHP script.
Comment