downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

apache_lookup_uri> <apache_get_version
[edit] Last updated: Fri, 17 May 2013

view this page in

apache_getenv

(PHP 4 >= 4.3.0, PHP 5)

apache_getenvRetorna uma variável subprocess_env do Apache

Descrição

string apache_getenv ( string $variable [, bool $walk_to_top ] )

Retorna a variável de ambiente do Apache especificada por variable.

Essa função requer Apache 2, caso contrário ela é indefinida.

Parâmetros

variable

A variável de ambiente do Apache

walk_to_top

Se deve ou não retorna a variável de alto-ní­vel disponí­veis em todas as camadas do Apache.

Valor Retornado

O valor da variável de ambiente do Apache se tiver sucesso, ou FALSE se falhar

Exemplos

Exemplo #1 Exemplo de uso da função apache_getenv()

O exemplo abaixo mostra como obter o valor da variável de ambiente do Apache SERVER_ADDR.

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

O exemplo acima irá imprimir algo similar à:

42.24.42.240

Veja Também



add a note add a note User Contributed Notes apache_getenv - [1 notes]
up
1
elhachmi at gmail dot com
2 months ago
apache_getenv(key) does not work on an php cgi installation, in this case rather use $_SERVER["REDIRECT_key"]

 
show source | credits | stats | sitemap | contact | advertising | mirror sites