(PHP4 >= 4.0.1)
string php_sapi_name (void)
string php_sapi_name
php_sapi_name()は、WebサーバーとPHP(サーバーAPI、 SAPI)の間のインターフェースの型を記述する文字列を返します。 CGI版のPHPでは、この文字列は"cgi"となり、Apacheのmod_php版では、 この文字列は"apache"となるといったようになります。
例 1. php_sapi_name()の例
$inter_type = php_sapi_name(); if ($inter_type == "cgi") print "CGI版のPHPを使用しています\n"; else print "CGI版のPHPを使用していません\n";