dmcdivitt Posted February 21, 2009 Share Posted February 21, 2009 With VB I often use "integer division" which is a backslash arithmetic operator rather than a forward slash. For instance 14 \ 3 is 4. Integer division throws away the remainder and returns only the integer result. What is the compliment of this in PHP? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/146267-solved-integer-division/ Share on other sites More sharing options...
Philip Posted February 21, 2009 Share Posted February 21, 2009 <?php $var = (int) (14/3); echo $var; ?> Will echo 4 Quote Link to comment https://forums.phpfreaks.com/topic/146267-solved-integer-division/#findComment-767912 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.