Top "Spl" questions

SPL is a collection of PHP interfaces and classes that are meant to solve standard problems.

php RecursiveDirectoryIterator: how to exclude directory paths with a dot and double dots?

RecursiveDirectoryIterator seems to give me two different results from my localhost and live server, define ('WEBSITE_DOCROOT', str_replace('\\…

php iterator spl
Peek ahead when iterating an array in PHP

Is it possible to "peek ahead" while iterating an array in PHP 5.2? For example, I often use foreach to manipulate …

php arrays foreach spl
Does really SplFixedArray perform better than arrays?

I'm testing the SplFixedArray building an array with the days of the week, and I get the following results: <?…

php arrays performance spl
Is it possible to use SplEnum in php 5.2.6?

I tried to use class : abstract class my_abstractEnum extends SplEnum { ... } and class my_categoryEnum extends my_abstractEnum { ... } and I …

php spl
How to close a SplFileObject file handler?

I'm working with files in PHP using SplFileInfo and SplFileObject. But when I try to "re-open" a file, it yells …

php spl
SplFileObject vs fopen in PHP

What are the pros and cons of using fopen as opposed to SplFileObject in PHP? From what I see, SplFileObject …

php file-io fopen spl splfileobject
multiple spl_autoload_register

what is/are the benefit(s) of having multiple spl_autoload_register example: spl_autoload_register('autoload_systems'); spl_autoload_…

php autoload spl
Sorting files with DirectoryIterator

I'm making a directory listing PHP5 script for lighttpd. In a given directory, I'd like to be able to list …

php spl
SPLFileInfo: get filename without extension

I'm accessing a number of files in the SPLFileInfo object. I see a way to get the path, filename, and …

php filenames file-extension spl fileinfo