PHP
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

php_uname> <php_logo_guid
Last updated: Fri, 18 Jul 2008

view this page in

php_sapi_name

(PHP 4 >= 4.0.1, PHP 5)

php_sapi_name — Restituisce il tipo di interfaccia tra il PHP ed il server web

Descrizione

string php_sapi_name ( void )

php_sapi_name() restituisce un testo minuscolo che descrive il tipo di interfaccia tra il PHP ed il server web (Server API, SAPI). In caso di CGI PHP, la stringa è "cgi", nel caso si usi mod_php per Apache, il testo sarà "apache" e così via.

Example #1 Esempio di uso di php_sapi_name()

<?php
$sapi_type 
php_sapi_name();
iif (substr($sapi_type03) == 'cgi') {
    echo 
"Si usa CGI PHP\n";
} else {
    echo 
"Non si usa CGI PHP\n";
}
?>



add a note add a note User Contributed Notes
php_sapi_name
Ysangkok
27-Aug-2008 02:34
This function can also return "cli" if PHP was launched from CLI. Useful if one wants to behave differently when running in console.

php_uname> <php_logo_guid
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites