$number = 1540;
 
for ($i = 1; $i <= $number; $i++) {
 
(int) $calculation  = $number / $i;
 
   if (preg_match('/^[0-9]+$/', $calculation)) {
 
         echo $calculation .', ';
 
   }
 
unset($calculation);
 
}

 

Categorized in: