2023-02-09 01:51:05 php分享记录
$tmp = [];for ($i = 2; $i * $i <= $num; ++$i) { while (0 === $num % $i) { $num = $num / $i; $tmp[] = $i; }}$tmp[] = $num;
$tmp = [];
for ($i = 2; $i * $i <= $num; ++$i) {
while (0 === $num % $i) {
$num = $num / $i;
$tmp[] = $i;
}
$tmp[] = $num;