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

search for in the

php_uname> <php_logo_guid
Last updated: Fri, 21 Nov 2008

view this page in

php_sapi_name

(PHP 4 >= 4.0.1, PHP 5)

php_sapi_nameReturns the type of interface between web server and PHP

Descrierea

string php_sapi_name ( void )

Returns a lowercase string which describes the type of interface between web server and PHP (Server API, SAPI). In CGI PHP, this string is "cgi", in mod_php for Apache, this string is "apache" and so on.

Valorile întroarse

Returns the interface type, as a lowercase string.

Exemple

Example #1 php_sapi_name() example

<?php
$sapi_type 
php_sapi_name();
if (
substr($sapi_type03) == 'cgi') {
    echo 
"You are using CGI PHP\n";
} else {
    echo 
"You are not using CGI PHP\n";
}
?>

Vedeţi de asemenea



add a note add a note User Contributed Notes
php_sapi_name
Ysangkok
28-Aug-2008 12: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, 21 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites