cvs: phpdoc /en/reference/image/figures dashedline.png stringup.png /en/reference/image/functions imagedashedline.xml imagestringup.xml
/en/reference/strings/functions nl2br.xml

From: Date: Thu, 14 Aug 2008 10:08:31 +0000
Subject: cvs: phpdoc /en/reference/image/figures dashedline.png stringup.png /en/reference/image/functions imagedashedline.xml imagestringup.xml
/en/reference/strings/functions nl2br.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-2028@lists.php.net to get a copy of this message
kalle Thu Aug 14 10:08:31 2008 UTC Added files: /phpdoc/en/reference/image/figures dashedline.png stringup.png Modified files: /phpdoc/en/reference/image/functions imagedashedline.xml imagestringup.xml /phpdoc/en/reference/strings/functions nl2br.xml Log: Added examples for: * imagedashedline * imagestringup And added example usage for is_xhtml parameter on nl2br() http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/imagedashedline.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/image/functions/imagedashedline.xml diff -u phpdoc/en/reference/image/functions/imagedashedline.xml:1.9 phpdoc/en/reference/image/functions/imagedashedline.xml:1.10 --- phpdoc/en/reference/image/functions/imagedashedline.xml:1.9 Tue Aug 5 07:32:04 2008 +++ phpdoc/en/reference/image/functions/imagedashedline.xml Thu Aug 14 10:08:22 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xml:id="function.imagedashedline" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>imagedashedline</refname> @@ -77,6 +77,36 @@ Always returns true </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>imagedashedline</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// Create a 100x100 image +$im = imagecreatetruecolor(100, 100); +$white = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); + +// Draw a vertical dashed line +imagedashedline($im, 50, 25, 50, 75, $white); + +// Save the image +imagepng($im, './dashedline.png'); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.dashedline.png"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/image/functions/imagestringup.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/image/functions/imagestringup.xml diff -u phpdoc/en/reference/image/functions/imagestringup.xml:1.9 phpdoc/en/reference/image/functions/imagestringup.xml:1.10 --- phpdoc/en/reference/image/functions/imagestringup.xml:1.9 Tue Aug 5 07:32:05 2008 +++ phpdoc/en/reference/image/functions/imagestringup.xml Thu Aug 14 10:08:26 2008 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.9 $ --> +<!-- $Revision: 1.10 $ --> <refentry xml:id="function.imagestringup" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>imagestringup</refname> @@ -69,6 +69,36 @@ &return.success; </para> </refsect1> + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title><function>imagestring</function> example</title> + <programlisting role="php"> +<![CDATA[ +<?php +// create a 100*100 image +$im = imagecreatetruecolor(100, 100); + +// Write the text +$textcolor = imagecolorallocate($im, 0xFF, 0xFF, 0xFF); +imagestringup($im, 3, 40, 80, 'gd library', $textcolor); + +// Save the image +imagepng($im, './stringup.png'); +imagedestroy($im); +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <imageobject> + <imagedata fileref="figures/image.imagestringup.png"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/strings/functions/nl2br.xml?r1=1.8&r2=1.9&diff_format=u Index: phpdoc/en/reference/strings/functions/nl2br.xml diff -u phpdoc/en/reference/strings/functions/nl2br.xml:1.8 phpdoc/en/reference/strings/functions/nl2br.xml:1.9 --- phpdoc/en/reference/strings/functions/nl2br.xml:1.8 Thu Aug 14 03:06:25 2008 +++ phpdoc/en/reference/strings/functions/nl2br.xml Thu Aug 14 10:08:26 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.nl2br"> <refnamediv> <refname>nl2br</refname> @@ -14,8 +14,8 @@ <methodparam><type>bool</type><parameter>is_xhtml</parameter></methodparam> </methodsynopsis> <para> - Returns <parameter>string</parameter> with '&lt;br /&gt;' inserted - before all newlines. + Returns <parameter>string</parameter> with '&lt;br /&gt;' or + '&lt;br&gt;' inserted before all newlines. </para> </refsect1> @@ -70,6 +70,23 @@ ]]> </screen> </example> + <example> + <title>Generating valid HTML markup using the <parameter>is_xhtml</parameter></title> + <programlisting role="php"> +<![CDATA[ +<?php +echo nl2br("Welcome\r\nThis is my HTML document", false); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +Welcome<br> +This is my HTML document +]]> + </screen> + </example> </para> </refsect1>

« previous php.doc.cvs (#2028) next »