clearConsole.php
Table of Contents
Functions
- clearConsole() : false|string
- Clears the terminal console screen, depending on the operating system.
Functions
clearConsole()
Clears the terminal console screen, depending on the operating system.
clearConsole([bool $clearable = true ]) : false|string
On Windows systems, it runs cls
; on Unix-based systems (Linux/macOS), it runs clear
.
If $clearable
is set to false
, the function does nothing and returns false
.
Note: The command relies on the system's availability of
cls
orclear
. Use with caution in restricted or sandboxed environments.
Parameters
- $clearable : bool = true
-
Whether or not to perform the console clear.
Tags
Return values
false|string —Returns the last line from the shell output, or false on failure or if $clearable
is false.