# How to factorize a number into PHP – Easy Way

In number theory, integer factorization is the breaking down of a composite number into smaller divisors, which when multiplied together equal the original number. By the fundamental theorem of arithmetic, every positive integer number, greater than one has a unique prime factorization.

Here’s how to factorize a number into php (two number integer factorization) :

```<?php

function factor_number(\$number) {
\$s = array(); \$f = array();
\$n2 = \$number/2;
for (\$i=1; \$i<=\$n2; \$i++) {
if (\$number % \$i == 0) {
\$k = \$number / \$i;
\$sum = \$i + \$k;
if (!in_array(\$sum, \$s)) {
\$f[] = \$i." * ".\$k;
\$s[] = \$sum;
}
}
}
return \$f;
}

echo '<pre>';
print_r(factor_number(6552));
echo '</pre>';```

And the result of the script is as follows:

```Array
(
 => 1 * 6552
 => 2 * 3276
 => 3 * 2184
 => 4 * 1638
 => 6 * 1092
 => 7 * 936
 => 8 * 819
 => 9 * 728
 => 12 * 546
 => 13 * 504
 => 14 * 468
 => 18 * 364
 => 21 * 312
 => 24 * 273
 => 26 * 252
 => 28 * 234
 => 36 * 182
 => 39 * 168
 => 42 * 156
 => 52 * 126
 => 56 * 117
 => 63 * 104
 => 72 * 91
 => 78 * 84
)```