use a different regular expression function... [man]preg_replace[/man] you can shorten the regex given by majik-sheff to just the begining of his
you want to find all leading 0's, and replace them with nothing
/0*/
// just say anything between these is the regular expression
^ matches the begining of the string
0 matches... well 0
- says match any number of the proceding thing including none, so it really means find any number of 0's
$string = preg_replace( '/0*/', '', $string );