← All built-ins / php_sapi()
php_sapi()
php_sapi(...$args): string
Parameters
Takes no arguments.
Return value
Alias of php_sapi_name() - the interface name ("cli" for command-line builds).
Example
echo php_sapi() == "cli" ? "cli" : "other";
cli