Client Login



Blog

Food for thought and inspiring minds

March 04, 2009

Removing Leading Zeros in PHP

It’s pretty easy to do, many thanks to laserlight at phpbuilder:

$var = ltrim($var, '0');

If there’s more than one zero use the following:

$value = 003;
$value = intval($value);

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment