TEENFRONT Posted October 4, 2006 Share Posted October 4, 2006 Hey Heyil just dive right in..$number = "00000000987" // $number could be anything but in 00000000000 format so it cud be 00000121214 etc.When i do thisecho $number;i want it to trim it to just "987" ... so knock off the starting 0's . Iv been playing around but i dont seem to be able to get it right. any help would be great! Its sending me wappy lol. Quote Link to comment Share on other sites More sharing options...
logu Posted October 4, 2006 Share Posted October 4, 2006 You can user eitherecho intval($number);orecho (int) $number;try it Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted October 4, 2006 Author Share Posted October 4, 2006 wooooooooooojesus! thanks so much logu. Quote Link to comment Share on other sites More sharing options...
tippy_102 Posted October 4, 2006 Share Posted October 4, 2006 $number = ltrim( $number, "0" ); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.