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.
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)RSS feed for comments on this post. TrackBack URL

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