#native_company# #native_desc#
#native_cta#

Prime factorization

By Hkon Brten
on May 14, 2008

Version: 1

Type: Function

Category: Math Functions

License: GNU General Public License

Description: Factorizes a given number

<?
function factorize ($number) {
	for ($i=2; $i < $number; $i++) {
		if (0 == ($number % $i)) {
			$factors[] = $i;
			$number = $number / $i;
			$i = 1;
		}
	}
	$factors[] = $number;
	return $factors;
}
?>