Forum und email

php_sapi_name

(PHP 4 >= 4.0.1, PHP 5)

php_sapi_name — Visszaadja, hogy milyen módon fut a PHP

Leírás

string php_sapi_name ( void )

A php_sapi_name() visszad egy kisbetűs string-et, ami megadja, hogy milyen felület van a szerver és a PHP között (Server API, SAPI). CGI PHP esetében, ez a string "cgi", Apache mod_php esetén "apache", stb.

Example#1 php_sapi_name() példa

<?php
$inter_type 
php_sapi_name();
if (
substr($sapi_type03) == 'cgi') {
    echo 
"Te CGI PHP-t használsz\n";
} else {
    echo 
"Te nem CGI PHP-t használsz\n";
}
?>