How to obtain the common factor and the maximum common factor between integers by PHP
How to obtain the common factor and the maximum common factor between integers by PHP? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Train of thought:
1. Get the factors between two integers an and b respectively, and then store these factors in an array.
Here, take the number 30 as an example, use the for loop to find all the factors:
For ($iSuppli.