If php has only one digit, add a 0?

hypothetical

$a = 1;
$b = 10;

suppose that $an is only one digit, then add 0 before it, and change 01
$b has ten digits, so do not add
this can be reached by what function?

Mar.03,2021

str_pad


str_pad($a,2,"0",STR_PAD_LEFT)

  • number of judgment digits
  • splicing

you can write a function yourself, using the knowledge of concatenating strings

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e3eda1-447f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e3eda1-447f7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?