How to output primes in a given range by php
This article is about how php can output primes in a given range. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Description
1. On the basis of for cycle, a layer of for loop is set on the outside to control the range.
2. In the inner body of the for loop, use the counter $count to increment 1 after each prime output, so that you can count the number of primes within 1100.
Example
Thank you for reading! This is the end of this article on "how php can output primes in a given range". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!