note 20242 deleted from function.str-pad by sander
| From: | sander@php.net | Date: | Fri, 03 May 2002 20:30:39 +0000 |
| Subject: | note 20242 deleted from function.str-pad by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-30144@lists.php.net to get a copy of this message | ||
I was experiencing some trouble when I needed zeros padded to the left. The string kept being parsed
as being a number and thus the zeros got removed. I don't know why but the only solution that
worked for me was that of matthew.somerville@trinity.oxford.ac.uk
$mystr = substr("0000$mystr",-4)