From 756b6457b6aff73a6c2720f057c36ac6cab2c10d Mon Sep 17 00:00:00 2001 From: Christoph Michael Becker Date: Mon, 31 Aug 2015 21:00:41 +0000 Subject: [PATCH] str_pad() never trims input string git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@337681 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/str-pad.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/strings/functions/str-pad.xml b/reference/strings/functions/str-pad.xml index b42216ad06..8d237f66b7 100644 --- a/reference/strings/functions/str-pad.xml +++ b/reference/strings/functions/str-pad.xml @@ -44,7 +44,7 @@ If the value of pad_length is negative, less than, or equal to the length of the input string, no padding - takes place. + takes place, and input will be returned. @@ -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" ?> ]]>