root root - 5 months ago 205
PHP Question

How can clear screen in php cli (like cls command)

When PHP script run from command line (windows) , how can clear the console screen from script .

for example :

while(true){
// sleep for 10 seconds , then clear the console
sleep(10);

// below command execute to clear the console windows
**COMMAND**
}

Answer

For Windows users :

system('cls');

For Linux users :

system('clear');
Comments