PHP - Ceros a la izquierda


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



Copy this code and paste it in your HTML
  1. function ceros($numero, $ceros=2){
  2. return sprintf("%0".$ceros."s", $numero );
  3. }
  4.  
  5. echo ceros(2, 5); #out 000002

Report this snippet


Comments


You need to login to view comments.