Added examples for:

* imagedashedline
* imagestringup

And added example usage for is_xhtml parameter on nl2br()


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@264826 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Kalle Sommer Nielsen 2008-08-14 10:08:30 +00:00
parent e22a96648d
commit fcef2ea0d9
5 changed files with 82 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

View file

@ -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>

View file

@ -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>

View file

@ -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>
@ -67,6 +67,23 @@ echo nl2br("foo isn't\n bar");
<![CDATA[
foo isn't<br />
bar
]]>
</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>