Standard PHP Library "Special topic"
Standard PHP Library
? ? Standard PHP library abbreviation spl,php. It is a set of interfaces and classes that are used to solve typical (common) problems. SPL mainly includes data structures, basic interfaces, basic functions, iterators, exceptions, and several other aspects. Frequently asked questions are:
?
- Mathematical modeling, data structure (solving the problem of how data is stored)
- Element traversal (data How to view problems)
- Unified invocation of common methods (including common methods [array, collection size], and custom traversal)
- Automatic loading of classes (PHP adapts to the management requirements of large-scale projects, dispersing the functionality into different files)
First, SPL commonly used data structure
?
?? ? ? ?
??
Second, SPL commonly used iterators
?
? 1. Arrayiterator iterator interface for traversing arrays
Convert the array of for, while, and foreach traversal into iterator to traverse.
?
? 2. Appenditerator can traverse several iterators in succession
? 3. Multipleiterator users to combine data from multiple iterator into one overall access
? 4, Outeriterator
?
Third, SPL basic interface
Iv. Common functions of SPL
?