note 44822 deleted from function.php-sapi-name by tomsommer
| From: | tomsommer@php.net | Date: | Tue, 17 Aug 2004 15:59:25 +0000 |
| Subject: | note 44822 deleted from function.php-sapi-name by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79700@lists.php.net to get a copy of this message | ||
Note Submitter: fontajos at phpeppershop dot com
----
Usually you want to determie if PHP runs as a server module or as a CGI program. Sometimes CGI
implementations don't simply return 'cgi' but some more detailed strings like e.g.
'cgi-fcgi', so you need a more sophisticated check. The following would do:
<?php
$sapi_result = php_sapi_name();
if (substr($sapi_result,0,3) == 'cgi') {
$sapi_result = 'cgi';
}
?>