php_sapi_name

php_sapi_name -- Vrátit typ rozhraní mezi web serverem a PHP Returns the type of interface between web server and PHP

Popis

string php_sapi_name ( void)

php_sapi_name( ) vrátí řetězec popisující malými písmeny typ rozhraní mezi web serverem a PHP (Server API , SAPI ) . U CGI PHP je tento řetězec " cgi" , u mod_php pro Apache je tento řetězec "apache " a tak dále .

Příklad 1 . php_sapi_name( ) Example

 
$sapi_type

 
=

 
php_sapi_name(

 
)

 
;

 
if

 
($sapi_type

 
==

 
"cgi"

 
)

 
print

 
"Používáte

 
CGI

 
PHP\n"

 
;

 
else

 
print

 
"Nepoužíváte

 
CGI

 
PHP\n"

 
;