|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-07-04 17:08 UTC] hholzgra@php.net
[2003-07-04 21:33 UTC] jc at mega-bucks dot co dot jp
[2003-07-05 01:43 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 13:00:01 2025 UTC |
str_pad pad the input string even when the length of the pad string cannot be evenly dived into the length of the input stirng + pad_length. This is not necessarily a bug but the behaviour should be documented. I.e. in some cases the user might want the string be padded only with *full-length* pad strings, and not truncated pad strings. The following code illustrates: echo str_pad("1", 2, "AB"); OUPUT: 1A The output could be viewed as "incorrect" since pad_str was aksed to pad with "AB", not to pad with "A". Thanks!