超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<apache_get_versionapache_lookup_uri>
Last updated: Fri, 22 Jun 2007

apache_getenv

(PHP 4 >= 4.3.0, PHP 5)

apache_getenv -- Get an Apache subprocess_env variable

Description

string apache_getenv ( string variable [, bool walk_to_top])

apache_getenv() returns the value of the Apache environment variable specified by variable, or FALSE on failure.

例子 1. apache_getenv() example

<?php
$ret
= apache_getenv("SERVER_ADDR");
echo
$ret;
?>

The example above shows how to retrieve the value of the Apache environment variable "SERVER_ADDR".

See also apache_setenv().




add a note add a note User Contributed Notes
apache_getenv
hela at helawann dot de
17-Aug-2004 10:09
Very easy but VERY cool to use:

For an index.php that will be installed on many servers that are installed in a web without DNS, the page should point to the server itself and, for example for a cups-webinterface to port 631. So, let磗 do it:

<a href="/testdir/">testlink</a>

<a href="http://<? echo apache_getenv("SERVER_ADDR"); ?>:631/">Cups Webinterface</a>


Have a lot of fun . . .

Hela

<apache_get_versionapache_lookup_uri>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22