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 — Devuelve el título del proceso actual
Devuelve el título del proceso actual, tal como se definió mediante la función cli_set_process_title(). Tenga en cuenta que este título puede ser ligeramente diferente al que se muestra mediante los comandos ps y top, según el sistema subyacente.
Esta función solo está disponible en modo CLI.
Esta función no tiene parámetros.
Devuelve el título del proceso actual, en forma de
una cadena de caracteres, o null
si ocurre un error.
Se generará una advertencia de nivel E_WARNING
si el sistema
subyacente no es compatible.
Ejemplo #1 Ejemplo con cli_get_process_title()
<?php
echo "Título del proceso: " . 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