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. Link to comment https://forums.phpfreaks.com/topic/22946-numbers-bloody-numbers/ 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 Link to comment https://forums.phpfreaks.com/topic/22946-numbers-bloody-numbers/#findComment-103538 Share on other sites More sharing options...
TEENFRONT Posted October 4, 2006 Author Share Posted October 4, 2006 wooooooooooojesus! thanks so much logu. Link to comment https://forums.phpfreaks.com/topic/22946-numbers-bloody-numbers/#findComment-103539 Share on other sites More sharing options...
tippy_102 Posted October 4, 2006 Share Posted October 4, 2006 $number = ltrim( $number, "0" ); Link to comment https://forums.phpfreaks.com/topic/22946-numbers-bloody-numbers/#findComment-103543 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.