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 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 Link to comment https://forums.phpfreaks.com/topic/146267-solved-integer-division/#findComment-767912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.