nezbo Posted March 19, 2008 Share Posted March 19, 2008 i have the got a var and i want to make it 4 number long... e.g. if i have 700 i want to make it 0700. is there a function or class to do this ? Link to comment https://forums.phpfreaks.com/topic/96985-how-to-set-a-700-to-0700/ Share on other sites More sharing options...
Psycho Posted March 19, 2008 Share Posted March 19, 2008 Assuming your var is named value: value = '0000' + value; value = value.substr(value.length-4, 4); Link to comment https://forums.phpfreaks.com/topic/96985-how-to-set-a-700-to-0700/#findComment-496407 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.