PHP trim multiple 00 infront

If the number provided is a string, convert it to int and will auto remove the addtional 00:

$string = "000989";
$string = (int)$string; //output integer "989"
$string = (string)$string; //output string "989"

By Keenlio, April 15, 2014

What do you think?

Leave a Reply

Your email address will not be published. Required fields are marked *

× seven = 42

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>