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