svn: /phpdoc/en/trunk/reference/strings/functions/ str-pad.xml
| From: | Christoph Michael Becker | Date: | Mon, 31 Aug 2015 21:00:41 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/strings/functions/ str-pad.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-13672@lists.php.net to get a copy of this message | ||
cmb Mon, 31 Aug 2015 21:00:41 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=337681
Log:
str_pad() never trims input string
Changed paths:
U phpdoc/en/trunk/reference/strings/functions/str-pad.xml
Modified: phpdoc/en/trunk/reference/strings/functions/str-pad.xml
===================================================================
--- phpdoc/en/trunk/reference/strings/functions/str-pad.xml 2015-08-31 19:46:08 UTC (rev 337680)
+++ phpdoc/en/trunk/reference/strings/functions/str-pad.xml 2015-08-31 21:00:41 UTC (rev 337681)
@@ -44,7 +44,7 @@
<para>
If the value of <parameter>pad_length</parameter> is negative,
less than, or equal to the length of the input string, no padding
- takes place.
+ takes place, and <parameter>input</parameter> will be returned.
</para>
</listitem>
</varlistentry>
@@ -96,7 +96,8 @@
echo str_pad($input, 10); // produces "Alien "
echo str_pad($input, 10, "-=", STR_PAD_LEFT); // produces "-=-=-Alien"
echo str_pad($input, 10, "_", STR_PAD_BOTH); // produces "__Alien___"
-echo str_pad($input, 6 , "___"); // produces "Alien_"
+echo str_pad($input, 6, "___"); // produces "Alien_"
+echo str_pad($input, 3, "*"); // produces "Alien"
?>
]]>
</programlisting>