forumnz Posted January 26, 2008 Share Posted January 26, 2008 I have a variable called $no which = 4.05. How can I make another $variable = just 4? Link to comment https://forums.phpfreaks.com/topic/87883-remove-05-from-405/ Share on other sites More sharing options...
laffin Posted January 26, 2008 Share Posted January 26, 2008 intval($val) floor($val) either shud do the trick. Link to comment https://forums.phpfreaks.com/topic/87883-remove-05-from-405/#findComment-449649 Share on other sites More sharing options...
tapos Posted January 26, 2008 Share Posted January 26, 2008 u can also use round($var); Link to comment https://forums.phpfreaks.com/topic/87883-remove-05-from-405/#findComment-449661 Share on other sites More sharing options...
Daniel0 Posted January 26, 2008 Share Posted January 26, 2008 The problem lies in that you are treating numbers and strings. You shouldn't. Numbers are numbers - strings are strings. Link to comment https://forums.phpfreaks.com/topic/87883-remove-05-from-405/#findComment-449689 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.