PHP: Pad single digit number to 2.


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $padded_num = str_pad($num, 2, 0, STR_PAD_LEFT);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.