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";
?>