mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 16:38:54 +00:00
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:
parent
34e0906c9d
commit
756b6457b6
1 changed files with 3 additions and 2 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue