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
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
cli_get_process_title — 現在のプロセスのタイトルを返す
現在のプロセスのタイトルを返します。これは cli_set_process_title() で設定したものです。 これは、ps や top で表示されるタイトルと必ずしも一致するとは限りません。OS に依存します。
この関数は、 CLI モードでしか使えません。
この関数にはパラメータはありません。
現在のプロセスのタイトルを文字列で返します。エラー時には null
を返します。
OS がこの機能に対応していない場合に E_WARNING
が発生します。
例1 cli_get_process_title() の例
<?php
echo "Process title: " . cli_get_process_title() . "\n";
?>
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
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