cvs: phpdoc /en/functions var.xml

From: Date: Sat, 15 Dec 2001 14:45:16 +0000
Subject: cvs: phpdoc /en/functions var.xml
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969339794@lists.php.net to get a copy of this message
derick Sat Dec 15 09:45:16 2001 EDT Modified files: /phpdoc/en/functions var.xml Log: - Added var_export documentation Index: phpdoc/en/functions/var.xml diff -u phpdoc/en/functions/var.xml:1.83 phpdoc/en/functions/var.xml:1.84 --- phpdoc/en/functions/var.xml:1.83 Wed Dec 12 18:00:47 2001 +++ phpdoc/en/functions/var.xml Sat Dec 15 09:45:15 2001 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.83 $ --> +<!-- $Revision: 1.84 $ --> <reference id="ref.variables"> <title>Variable Functions</title> <titleabbrev>Variables</titleabbrev> @@ -1448,6 +1448,72 @@ */ ?>; +</pre> +]]> + </programlisting> + </informalexample> + </para> + </refsect1> + </refentry> + + + <refentry id="function.var-export"> + <refnamediv> + <refname>var_export</refname> + <refpurpose>Outputs or returns a string representation of avariable</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcprototype> + <funcdef>mixed <function>var_export</function></funcdef> + <paramdef>mixed <parameter>expression</parameter></paramdef> + <paramdef>int <parameter><optional>return</optional></parameter></paramdef> + </funcprototype> + </funcsynopsis> + <simpara> + This function returns structured information about the variable that is + passed to this function. It is similar to <function>var_dump</function> + with the exception that the returned representation is valid PHP code. + </simpara> + <simpara> + You can also return the variable representation by using &true; as + second parameter to this function. + </simpara> + <simpara> + Compare <function>var_export</function> to + <function>var_dump</function>. + </simpara> + <para> + <informalexample> + <programlisting role="php"> +<![CDATA[ +<pre> +<?php +$a = array (1, 2, array ("a", "b", "c")); +var_export ($a); + +/* output: +array ( + 0 => 1, + 1 => 2, + 2 => + array ( + 0 => 'a', + 1 => 'b', + 2 => 'c', + ), +) +*/ + +$b = 3.1; +$v = var_export($b, TRUE); +echo $v; + +/* output: +3.1 +*/ +?> </pre> ]]> </programlisting>

« previous php.doc (#969339794) next »