downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  

<php_logo_guidphp_uname>
Last updated: Thu, 26 Jun 2008

php_sapi_name

(PHP 4 >= 4.0.1, PHP 5)

php_sapi_name — Returns the type of interface between web server and PHP

Description

string php_sapi_name ( void )

Returns a lowercase string which describes the type of interface between web server and PHP (Server API, SAPI). In CGI PHP, this string is "cgi", in mod_php for Apache, this string is "apache" and so on.

Return Values

Returns the interface type, as a lowercase string.

Examples

Example #1 php_sapi_name() example

<?php
$sapi_type
= php_sapi_name();
if (
substr($sapi_type, 0, 3) == 'cgi') {
   echo
"You are using CGI PHP\n";
} else {
   echo
"You are not using CGI PHP\n";
}
?>

See Also



add a noteadd a note User Contributed Notes
Returns the type of interface between web server and PHP
There are no user contributed notes for this page.




<php_logo_guidphp_uname>
Last updated: Thu, 26 Jun 2008
show source | credits | sitemap | contact | advertising | mirror sites
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://phpbuilder.com/
Last updated: Tue Nov 1 20:20:59 2005 EST
Columns / Articles | Tips / Quickies | News | News Linking and RSS Feeds | Shared Code Library
Mail Archives | Support / Discussion Forums | Get Started! Links | Contribute! | Docs