PHP 8.0.6 Released!


(PHP 4 >= 4.0.7, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)

ncurses_clearClear screen


ncurses_clear ( ) : bool

Esta função é EXPERIMENTAL. O comportamento, seu nome e documentação podem mudar sem aviso em futuras versões do PHP. Utilize por sua própria conta e risco.

Clears the screen completely without setting blanks.

Note: ncurses_clear() clears the screen without setting blanks, which have the current background rendition. To clear screen with blanks, use ncurses_erase().

Valor Retornado

Retorna true em caso de sucesso ou false em caso de falha.

Veja Também

add a note add a note

User Contributed Notes 1 note

areaz at dotgeek org
16 years ago
When your script exits, after ncurses_clear() was called, it could leave your terminal in an inconsistent state.

Therefore, you should call ncurses_savetty() in a constructor and nurses_resetty() in a destructor, to ensure, that your terminal is working fine after your script exits.

Here is an example code snippet, on how to use this function, without falling into trouble ;-)

<? // PHP5 Example

class foo
    /* Foo constructor */
    function __construct()
        /* Initialize ncurses first */

        /* Save your tty !!! */

    function bar ()
        /* Clear the screen and wait a few seconds */


    /* Foo destructor */
    function __destruct()
        /* Restore your terminal settings */

        /* End ncurses and clean up */


$test_ncurses = new foo;
To Top