cli_get_process_title

(PHP 5 >= 5.5.0, PHP 7, PHP 8)

cli_get_process_title現在のプロセスのタイトルを返す

説明

cli_get_process_title(): ?string

現在のプロセスのタイトルを返します。これは cli_set_process_title() で設定したものです。 これは、pstop で表示されるタイトルと必ずしも一致するとは限りません。OS に依存します。

この関数は、 CLI モードでしか使えません。

パラメータ

この関数にはパラメータはありません。

戻り値

現在のプロセスのタイトルを文字列で返します。エラー時には null を返します。

エラー / 例外

OS がこの機能に対応していない場合に E_WARNING が発生します。

例1 cli_get_process_title() の例

<?php
echo "Process title: " . cli_get_process_title() . "\n";
?>

参考

add a note

User Contributed Notes 1 note

up
0
pgl at yoyo dot org
11 years ago
For versions of PHP < 5.5.0, you can get the name of the script from $argv[0]: http://www.php.net/manual/en/reserved.variables.argv.php
To Top

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant