How to use PHP generator
This article mainly shows you "how to use PHP generator", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use PHP generator" this article.
What is the PHP generator?
The generator, added in version 5.5 of PHP, provides an easy way to traverse data without having to build arrays in memory. Are you a little confused? As an example, it is a good way to show that using generators is a good way.
First, create a generator.php file that will run through our entire example. After creating the file, we add a piece of code.