0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PHPで特殊なエスケープシーケンスを出力する

Posted at

エスケープシーケンス

コンソールに echoprint"\r" などを出力すれば普通のエスケープシーケンスは出力できるんだけど、例えば「行消去」(\e[2K)のような特殊なエスケープシーケンスの出力方法がすぐに分からなかったのでメモ。

  // エスケープシーケンスで行全体を消去
  echo chr(27) . "[2K";

進捗表示をやりたいときに "\r" だけだと消去できなかったので。

参考

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?