Find total number of divisors of an integer in PHP

Standard

In mathematics, a divisor of an integer n, also called a factor of n, is an integer which divides n without leaving a remainder. Ok, so if you are asked to tell the total number of divisors of 24, it’s easy and the answer is 8 as the number 24 is divided by 1, 2, 3, 4, 6, 8, 12 and 24. Now, how will you implement in PHP programming? You might take the following approach: Continue reading