Remove leading zero's from a string


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



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $str = "00001030";
  4.  
  5. print ltrim($str, "0"); // left trim the '0' character from string
  6.  
  7. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.