php-doc-en/reference/var/functions/get-defined-vars.xml
Torben Wilson af4410a7e1 Normalized the sgml-default-dtd-file local-variable line for those
still using this, after discussion on the phpdoc list.
From now on, manual.ced will need to be found at ~/.phpdoc/manual.ced.



git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@288721 c90b9560-bf6c-de11-be94-00142212c4b1
2009-09-25 07:04:39 +00:00

117 lines
2.7 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<refentry xml:id="function.get-defined-vars" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>get_defined_vars</refname>
<refpurpose>
Returns an array of all defined variables
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>get_defined_vars</methodname>
<void/>
</methodsynopsis>
<para>
This function returns a multidimensional array containing a list of
all defined variables, be them environment, server or user-defined
variables, within the scope that <function>get_defined_vars</function> is
called.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
A multidimensional array with all the variables.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>get_defined_vars</function> Example</title>
<programlisting role="php">
<![CDATA[
<?php
$b = array(1, 1, 2, 3, 5, 8);
$arr = get_defined_vars();
// print $b
print_r($arr["b"]);
/* print path to the PHP interpreter (if used as a CGI)
* e.g. /usr/local/bin/php */
echo $arr["_"];
// print the command-line parameters if any
print_r($arr["argv"]);
// print all the server vars
print_r($arr["_SERVER"]);
// print all the available keys for the arrays of variables
print_r(array_keys(get_defined_vars()));
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>5.0.0</entry>
<entry>
The <varname>$GLOBALS</varname> variable is included in the results of
the array returned.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>isset</function></member>
<member><function>get_defined_functions</function></member>
<member><function>get_defined_constants</function></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
-->