php_sapi_name 


php128 apg

GETS the type of interface between the web server and PHP.

SAPI = Server Application Programming Interface.

It is the mechanism that controls the interaction between the outside world and the PHP/Zend engine.

So, you would always want to use it.

In fact, you cannot avoid using it without a lot of effort since even CLI is considered a SAPI.





The STRING in lowercase returned by this function describes the type of interface Server API, SAPI, that PHP is using.

The constant PHP_SAPI has the same value as this function.



<?php

str php_sapi_name 
( )

?>

  1 EXERCISE   

<?php

echo php_sapi_name(); 

// The PHP constant PHP_SAPI 
// has the same value as php_sapi_name

echo '<br><br>' PHP_SAPI;
        
?>

 RESULT   

apache2handler

apache2handler


In your system, it may be different.