cvs: phpdoc /en/reference/strings/functions vprintf.xml vsprintf.xml /en/reference/var/functions gettype.xml is-null.xml
| From: | Felipe Pena | Date: | Fri, 10 Oct 2008 18:12:54 +0000 |
| Subject: | cvs: phpdoc /en/reference/strings/functions vprintf.xml vsprintf.xml /en/reference/var/functions gettype.xml is-null.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2225@lists.php.net to get a copy of this message | ||
felipe Fri Oct 10 18:12:54 2008 UTC
Modified files:
/phpdoc/en/reference/strings/functions vprintf.xml vsprintf.xml
/phpdoc/en/reference/var/functions gettype.xml is-null.xml
Log:
- Added examples
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/vprintf.xml?r1=1.8&r2=1.9&diff_format=u
Index: phpdoc/en/reference/strings/functions/vprintf.xml
diff -u phpdoc/en/reference/strings/functions/vprintf.xml:1.8
phpdoc/en/reference/strings/functions/vprintf.xml:1.9
--- phpdoc/en/reference/strings/functions/vprintf.xml:1.8 Sun Mar 23 22:42:50 2008
+++ phpdoc/en/reference/strings/functions/vprintf.xml Fri Oct 10 18:12:54 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.vprintf">
<refnamediv>
<refname>vprintf</refname>
@@ -54,6 +54,22 @@
Returns the length of the outputted string.
</para>
</refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>vprintf</function>: zero-padded integers</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+vprintf("%04d-%02d-%02d", explode('-', '1988-8-1')); // 1988-08-01
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/vsprintf.xml?r1=1.8&r2=1.9&diff_format=u
Index: phpdoc/en/reference/strings/functions/vsprintf.xml
diff -u phpdoc/en/reference/strings/functions/vsprintf.xml:1.8
phpdoc/en/reference/strings/functions/vsprintf.xml:1.9
--- phpdoc/en/reference/strings/functions/vsprintf.xml:1.8 Sun Mar 23 22:42:50 2008
+++ phpdoc/en/reference/strings/functions/vsprintf.xml Fri Oct 10 18:12:54 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<refentry xmlns="http://docbook.org/ns/docbook"
xml:id="function.vsprintf">
<refnamediv>
<refname>vsprintf</refname>
@@ -51,6 +51,22 @@
for <function>sprintf</function>).
</para>
</refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>vsprintf</function>: zero-padded integers</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+print vsprintf("%04d-%02d-%02d", explode('-', '1988-8-1')); //
1988-08-01
+?>
+]]>
+ </programlisting>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/var/functions/gettype.xml?r1=1.11&r2=1.12&diff_format=u
Index: phpdoc/en/reference/var/functions/gettype.xml
diff -u phpdoc/en/reference/var/functions/gettype.xml:1.11
phpdoc/en/reference/var/functions/gettype.xml:1.12
--- phpdoc/en/reference/var/functions/gettype.xml:1.11 Thu Feb 21 01:38:53 2008
+++ phpdoc/en/reference/var/functions/gettype.xml Fri Oct 10 18:12:54 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.11 $ -->
+<!-- $Revision: 1.12 $ -->
<refentry xml:id="function.gettype" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>gettype</refname>
@@ -99,6 +99,38 @@
</itemizedlist>
</para>
</refsect1>
+
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>gettype</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$data = array(1, 1., NULL, new stdClass, 'foo');
+
+foreach ($data as $value) {
+ echo gettype($value), "\n";
+}
+
+?>
+]]>
+ </programlisting>
+ &example.outputs.similar;
+ <screen>
+<![CDATA[
+integer
+double
+NULL
+object
+string
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/var/functions/is-null.xml?r1=1.8&r2=1.9&diff_format=u
Index: phpdoc/en/reference/var/functions/is-null.xml
diff -u phpdoc/en/reference/var/functions/is-null.xml:1.8
phpdoc/en/reference/var/functions/is-null.xml:1.9
--- phpdoc/en/reference/var/functions/is-null.xml:1.8 Wed Jun 20 22:25:34 2007
+++ phpdoc/en/reference/var/functions/is-null.xml Fri Oct 10 18:12:54 2008
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<refentry xml:id="function.is-null" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>is_null</refname>
@@ -39,6 +39,33 @@
otherwise.
</para>
</refsect1>
+ <refsect1 role="examples">
+ &reftitle.examples;
+ <para>
+ <example>
+ <title><function>is_null</function> example</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+error_reporting(E_ALL);
+
+$foo = NULL;
+var_dump(is_null($inexistent), is_null($foo));
+
+?>
+]]>
+ </programlisting>
+ <screen>
+<![CDATA[
+Notice: Undefined variable: inexistent in ...
+bool(true)
+bool(true)
+]]>
+ </screen>
+ </example>
+ </para>
+ </refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>