Check if a Number is Multiple of Another Number in PHP
PHP function to check if a number is multiple of another:
function is_multiple($number, $multiple) { return (($number % $multiple) == 0) ? true : false; } |
Example usage:
if(is_multiple(4,2)) echo "True"; else echo "False"; |
More Related Posts
- [2016/05/19] Check if a String Contains Multiple Wo...
- [2016/06/07] How to Get File Extension in PHP
- [2016/05/20] Turn Off Expose_PHP (Hide X-Powered-By...
- [2016/05/26] How to Increase PHP Memory Limit
- [2016/05/25] Disable PHP Notice: Undefined variable...
- [2016/05/27] PHP Domain Parser: Domain\URL Parser P...
- [2016/05/19] Validate Value as Integer in PHP
- [2016/05/19] Remove Non-Alphanumeric Characters fro...