note 14354 deleted from function.str-pad by sander
| From: | sander@php.net | Date: | Fri, 03 May 2002 20:30:19 +0000 |
| Subject: | note 14354 deleted from function.str-pad by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30146@lists.php.net to get a copy of this message | ||
The remark from mics.anders is not correct since str_repeat is also not available before PHP4. I
always use the following substr construct:<br>
$mystr = substr("0000",0,3-strlen($mystr)) . $mystr;
// "0000" = the string with padding chars
// 3 = maxlength where to pad to