php_sapi_name
(PHP4 >= 4.0.1)
php_sapi_name --- 傳回web伺服與PHP之間的介面型態
語法 :
string php_sapi_name(void)說明 :
php_sapi_name( )傳回一個小寫的字串,說明web伺服器與PHP(Server API, SAPI)之間的介面型態。CGI PHP,此字串將會是"cgi";Aapache的mod_php,此字串將會是"apache"等等。
Example :
<?php
$inter_type = php_sapi_name();
if ($inter_type == "cgi")
print "You are using CGI PHP\n";
else
print "You are not using CGI PHP\n";
?>