mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
- Added var_export documentation
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@65163 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
8d6ce3b4a0
commit
c96e2854ab
1 changed files with 67 additions and 1 deletions
|
@ -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>
|
||||
|
@ -1456,6 +1456,72 @@ bool(true)
|
|||
</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>
|
||||
</informalexample>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
</reference>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
|
Loading…
Reference in a new issue