note
JaWi
First of all: the used algorithm passed '1' for a prime while it isn't! A prime should have two and only two <b>different</b> integer divisors...
<p>
Secondly, you could speed things up a little more: you only need to check all integer numbers up to <code>ceil( $input / 2 )</code> because of the commutative properties of integers (2*3 == 3*2).<br/>
Furthermore, prime are always (except for '2', so almost always) odd numbers, so you could skip them in your test for even more speed improvement!
<p>
-- JaWi
<p>
"A chicken is an egg's way of producing more eggs."
203769
203769