str_pad() never trims input string

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337681 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Christoph Michael Becker 2015-08-31 21:00:41 +00:00
parent 34e0906c9d
commit 756b6457b6

View file

@ -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 @@ $input = "Alien";
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>