spl
Sort directory listing using RecursiveDirectoryIterator
I\'m using RecursiveDirectoryIterator and RecursiveIteratorIterator to build a file listing tree using code like below. I need to the list to be sorted - either directories then files alphabetically,[详细]
2023-01-01 04:43 分类:问答A RecursiveParentChildIterator -- like the RecursiveDirectoryIterator
There are tons of examples of using the RecursiveIterator to flatten a tree structure.. but what about using it to explode a tree structure?[详细]
2022-12-28 20:19 分类:问答How do I aggregate results from an Adjacency list using PHP's SPL
I\'ve tried using nested sets, and they become very difficult to maintain when dealing with multiple trees and lots of other complications.. I\'d like to give PHP\'s SPL library a stab at this (btw, w[详细]
2022-12-27 16:58 分类:问答Correct way of setting a custom FileInfo class to an Iterator
I am trying to set a custom class to an Iterator through the setInfoClass method: Use this method to set a custom class which will be used when getFileInfo and getPathInfo are called. The class name[详细]
2022-12-25 19:36 分类:问答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 data from an array:[详细]
2022-12-23 17:07 分类:问答How can I retrieve the full directory tree using SPL?
How can I retrieve the full directory tree using SPL开发者_开发知识库, possibly using RecursiveDirectoryIterator and RecursiveIteratorIterator?By default, the RecursiveIteratorIterator will use LEAVES[详细]
2022-12-22 07:17 分类:问答Extended PHP ArrayObject Does Not Work Properly
I\'m trying to extend the SPL ArrayObject but I\'ve hit a little snag.Using an unmodified ArrayObject, this code works:[详细]
2022-12-21 22:39 分类:问答Which PHP interface allows objects' properties to be accessible with array notation?
Which PHP SPL interface allows objects to do this: $object->month = \'january\'; echo $object[\'month\']; // january[详细]
2022-12-20 18:30 分类:问答Using an object as an array
In recent updates to PHP, they added in various interfaces to allow an object to be treated as an array, such as ArrayAccess, Iterator, Countable, etc.[详细]
2022-12-19 04:04 分类:问答(syntax trees) recursively iterating over trees bottom-up with current top-down path
I have an abstract syntax tree which I need to iterate. The AST is generated by the lemon port to PHP.[详细]
2022-12-17 09:01 分类:问答