在 PHP 中使用 ncurses 动态更新计数

发布于 2024-10-04 03:43:39 字数 184 浏览 0 评论 0原文

以这个PHP脚本为例:

$i = 0;
foreach ($arrKey as $VarKey)
{
    $i++
    echo $i;
}

我想使用ncurses让它动态更新echo,这样就不会每次都回显,只有数字发生变化。问题是,我不知道该怎么做。有人能指出我正确的方向吗?

Take this PHP script for example:

$i = 0;
foreach ($arrKey as $VarKey)
{
    $i++
    echo $i;
}

I would like to use ncurses to make it dynamically update the echo, so that instead of echoing each time, only the number changes. Problem is, I have no idea how to do this. Can anyone point me in the right direction?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情何以堪。 2024-10-11 03:43:39

对于初学者来说,您最好阅读 PHP ncurses 手册

还发现了Zend Developer Zone 上关于使用的合理教程 ncurses 库,因为 PHP 手册本身并没有很好地介绍如何实际使用它。

然而,这种控制台操作不适合胆小的人。

Well you had better read the PHP ncurses manual for starters.

Also found a reasonable tutorial on the Zend Developer Zone regarding the use of the ncurses library, as the PHP manual on it's own does not give a good introduction on how to actually go about using it.

This sort of console manipulation is not for the feint-hearted however.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文