What I am trying to build is a function that takes an input number and checks if the following number is a multiple of that number.
function checkIfMult($input,$toBeChecked){
// some logic
}
example:
checkIfMult(2,4) // true
checkIfMult(2,6) // true
checkIfMult(2,7) // false
checkIfMult(3,6) // true
checkIfMult(3,9) // true
checkIfMult(3,10) // false
My first instinct was to use arrays
$tableOf2 = [2,4,6,8,10,12,14,16,18]
But then a call like this would be highly unpractical:
checkIfMult(6,34234215)
How can I check to see if something is a multiple of the input?