The most comprehensive of all tutorials regarding SPL has been written with some help from Marcus and can be found here.
http://www.phpro.org/tutorials/Introduction-to-SPL.html
Enjoy
![]() | CXL. Standard PHP Library (SPL) Functions简介SPL is a collection of interfaces and classes that are meant to solve standard problems.
安装This extension is available and compiled by default in PHP 5.
![]()
kevin at oceania dot net
07-Mar-2006 04:21
The most comprehensive of all tutorials regarding SPL has been written with some help from Marcus and can be found here.
ville</.>witt</a>gmail</.>com
13-Jan-2006 04:37
These to funtions has excatly the same output, the only diff. is in which directory iterator they use. I hope someone out there can use it:
jce at vt dot ilw dot agrl dot ethz dot ch
11-Nov-2005 03:51
You may access the ArrayObject as an array by using explicit typecasts:
adove at booyahnetworks dot com
11-Oct-2005 01:45
Something to note that, at least to me, seems pretty important and is not entirely clear in the documentation is the fact that the ArrayObject class supports get/set on uni-dimensional keys and get ONLY on *passed* multi-dimensional keys/paths (see source below). If you, like me, need to support array accesss overloading for multi-dimensional data, you will need to derive from ArrayObject and overide the ArrayAccess interface methods to "walk" passed data and convert embedded arrays to objects of some kind...
helly at php dot net
25-Sep-2005 05:41
There is a RecursiveFilterIterator that makes the above code much easier. And then ther is ParentIterator thta is already a filtering recursive iterator that only accepts elements that have children, with a RecursiveDirectoryIterator as inner iterator you would obviously get only the directories. Further more it ensures that it creates the correct children. All in all you simply need to do this:
ericjr [!_ at _!] junioronline dot us
12-Jul-2005 07:57
In addition to "mastabog at hotmail dot com"`s note about the recursive directory iterator, his method skips symlinked directories, because getChildren() doesn't return true if the directory is symlinked.
just_somedood at yahoo dot com
28-Jun-2005 03:11
Just a follow up on dave at tunasoft's post. To give his example of ArrayAccess use of foreach, it's easiest to implement IteratorAggregate and use the ArrayIterator object as the iterator, as below:
zaufi at sendmail dot ru
17-Apr-2005 10:24
I'v done with my PluginsManager... Sample code to use plugins may looks lije this:
<nospam>mike[ at ]emesdee.net</nospam>
23-Nov-2004 04:47
Excelent article here by Harry Fuecks...
mastabog at hotmail dot com
18-Aug-2004 05:41
Marcus Boerger has done a wonderful job developing the SPL. He also provided many examples using the SPL that can be found in the php5 sources. Just unpack the sources and in the ext/spl/examples directory you have some very nice ones. Thank you Marcus for all your efforts!
dave at tunasoft dot com
10-Aug-2004 09:28
There are some interfaces used here that are not documented. It took a bit to figure this one out, but you can create your own ArrayObject type class (that is, one who's objects can be access using the array [$index] syntax).
phil &ersat; flatnet.net
18-Apr-2004 06:11
Here's a sample implementation of the RecursiveDirectoryIterator class. It prints a simple treeview of a given directory:
| ![]() |