mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@313550 c90b9560-bf6c-de11-be94-00142212c4b1
105 lines
2.7 KiB
XML
105 lines
2.7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: f2049e4661c2459f631534e1bb1d5acce65d416f Maintainer: chuso Status: ready -->
|
|
<refentry xml:id="function.getenv" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>getenv</refname>
|
|
<refpurpose>Obtiene el valor de una variable de entorno</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>getenv</methodname>
|
|
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Obtiene el valor de una variable de entorno.
|
|
</para>
|
|
<para>
|
|
Se puede ver una lista de todas las variables de entorno usando
|
|
<function>phpinfo</function>. Muchas de estas variables están listadas bajo la especificación
|
|
<link xlink:href="&url.rfc;3875">RFC 3875</link>, específicamente
|
|
la sección 4.1, "Request Meta-Variables".
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>varname</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El nombre de variable.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Devuelve el valor de la variable de entorno
|
|
<parameter>varname</parameter>, o &false; si la variable
|
|
entorno <parameter>varname</parameter> no existe.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Ejemplo de <function>getenv</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// Ejemplo de uso de getenv()
|
|
$ip = getenv('REMOTE_ADDR');
|
|
|
|
// O simplemente use una Superglobal ($_SERVER o $_ENV)
|
|
$ip = $_SERVER['REMOTE_ADDR'];
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>putenv</function></member>
|
|
<member><function>apache_getenv</function></member>
|
|
<member><link linkend="language.variables.superglobals">Superglobales</link></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|