note 56800 deleted from function.str-repeat by sobak
| From: | sobak@php.net | Date: | Sat, 10 Dec 2016 11:19:37 +0000 |
| Subject: | note 56800 deleted from function.str-repeat by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-208434@lists.php.net to get a copy of this message | ||
Note Submitter:
----
In reply to what Roland Knall wrote:
It is much simpler to use printf() or sprintf() for leading zeros.
<?php
printf("%05d<br>\n", 1); // Will echo 00001
sprintf("%05d<br>\n", 1); // Will return 00001
?>