mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
e22a96648d
commit
fcef2ea0d9
5 changed files with 82 additions and 5 deletions
BIN
reference/image/figures/dashedline.png
Normal file
BIN
reference/image/figures/dashedline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 167 B |
BIN
reference/image/figures/stringup.png
Normal file
BIN
reference/image/figures/stringup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 379 B |
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 '<br />' inserted
|
||||
before all newlines.
|
||||
Returns <parameter>string</parameter> with '<br />' or
|
||||
'<br>' 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>
|
||||
|
|
Loading…
Reference in a new issue