dimkasmir Posted May 8, 2008 Share Posted May 8, 2008 I'm wondering how it is possible to "cut off" the ones place for a number. For example for input 3256, the input would be 325; for 124, 12; etc. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/104775-solved-need-help-with-formatting-a-number/ Share on other sites More sharing options...
radar Posted May 8, 2008 Share Posted May 8, 2008 You could do something like this. $item = '3256'; $item = substr($item, 0, -1); that should work with your given values. Link to comment https://forums.phpfreaks.com/topic/104775-solved-need-help-with-formatting-a-number/#findComment-536362 Share on other sites More sharing options...
dimkasmir Posted May 8, 2008 Author Share Posted May 8, 2008 Great, exactly what I needed! Link to comment https://forums.phpfreaks.com/topic/104775-solved-need-help-with-formatting-a-number/#findComment-536382 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.