JavaScript Editor Javascript debugger     Website design 

php_sapi_name

Returns the type of interface between web server and PHP (PHP 4 >= 4.0.1, PHP 5)
string php_sapi_name ( )

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.

Return Values

Returns the interface type, as a lowercase string.

Examples

Example 1849. php_sapi_name() example

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


See Also
PHP_SAPI