We participate in the Amazon Service LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com

Factor Finder
// Number to factor
$num = 60;

// Loop from the number to factor down to 1
for($i=$num; $i>=1; $i--){
    // If it divides evenly
    if($num % $i === 0 ){
        // Output result of division, which is a factor
        echo $num / $i . '<br />';
    }
}

Output:

1
2
3
4
5
6
10
12
15
20
30
60

*To find a factor, divide by a number, and if the result is a whole number, then both the answer, and the number you divided by are factors.*