PHP | check prime number

There are 2 best-optimised logic for the checking prime number. Here matter of optimised mean, minimising Iterations. let’s start doing both scenario’s. Iterate through all numbers from 2 to n/2 and every number in between (2 to n/2) check it divides n or not. if n divided then return false(0) otherwise true(1) Result is : … Read more