©
This document uses PHP Chinese website manual Release
(PHP 4 >= 4.0.7, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)
ncurses_clear — Clear screen
此函数是实验性的。此函数的表象,包括名称及其相关文档都可能在未来的 PHP 发布版本中未通知就被修改。使用本函数风险自担 。
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() .
成功时返回 TRUE
, 或者在失败时返回 FALSE
。
[#1] areaz at dotgeek org [2004-05-13 15:49:33]
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 ;-)
<?php // PHP5 Example
class foo
{
function __construct()
{
ncurses_init();
ncurses_savetty();
}
function bar ()
{
ncurses_clear();
sleep(5);
}
function __destruct()
{
ncurses_resetty();
ncurses_end();
}
}
$test_ncurses = new foo;
$test_ncurses->bar();
?>