Home > Article > Backend Development > How to implement judgment of integer division in PHP
php implementation method for determining integer division: first create a PHP code sample file; then use the "%" operator to determine whether the result of dividing two numbers is 0. If the result is 0, it means that it can be divided into integers; finally execute this Just file.
php determines whether two numbers are divisible:
function zhengchu(m,n){ if(m%n == 0){//取余 若结果为0代表能够整除 echo "能够整除"; }else{ echo "不能整除"; } } //测试 zhengchu(10,3);
For more related knowledge, please visit PHP Chinese website!
The above is the detailed content of How to implement judgment of integer division in PHP. For more information, please follow other related articles on the PHP Chinese website!