Re: [PHP] SPL Recursive Iterator Examples

2013-03-19 Thread Alain Williams
On Tue, Mar 19, 2013 at 04:40:59AM -0700, NaMarPi wrote: > > > I have not found enough documents about Recursive Iterators on the net, so > started to collect my mini-examples here: > > > https://github.com/namarpi/PHP-SPL-Recursive-Examples If you are putting them up as examples, then it wou

Re: [PHP] SPL

2007-10-30 Thread Børge Holen
On Monday 29 October 2007 16:26:13 Jim Lucas wrote: > Børge Holen wrote: > > On Sunday 28 October 2007 07:27:53 you wrote: > >> Børge Holen wrote: > >>> I found this code at php.net witch needs very little modifications and > >>> can do so much, but I can't figure out how to make it read alphabetic

Re: [PHP] SPL

2007-10-29 Thread Jim Lucas
Børge Holen wrote: On Sunday 28 October 2007 07:27:53 you wrote: Børge Holen wrote: I found this code at php.net witch needs very little modifications and can do so much, but I can't figure out how to make it read alphabeticly as mentioned $it = new RecursiveDirectoryIterator($

Re: [PHP] SPL

2007-10-28 Thread Børge Holen
On Sunday 28 October 2007 15:37:21 Nathan Nobbe wrote: > i suppose this is what youre looking for ? > you can tailor it to your needs of course :) > > $it = new RecursiveDirectoryIterator('.'); > $isFirstDir = true; > $fileList = array(); > $dynfile = fopen('sortedFiles', 'w+'); > $theRecursiveIte

Re: [PHP] SPL

2007-10-28 Thread Nathan Nobbe
i suppose this is what youre looking for ? you can tailor it to your needs of course :) isDir()){ /// drop the name of the directory into the results fwrite($dynfile, 'Directory: ' . (string) $path . PHP_EOL); if($isFirstDir) { // just update t

Re: [PHP] SPL

2007-10-28 Thread Børge Holen
On Sunday 28 October 2007 07:27:53 you wrote: > Børge Holen wrote: > > I found this code at php.net witch needs very little modifications and > > can do so much, but I can't figure out how to make it read alphabeticly > > as mentioned > > > > $it = new RecursiveDirectoryIterator($_GET['

Re: [PHP] SPL

2007-10-28 Thread Børge Holen
On Sunday 28 October 2007 02:57:13 Jochem Maas wrote: > Børge Holen wrote: > > On Sunday 28 October 2007 01:32:15 you wrote: > >> On 10/27/07, Børge Holen <[EMAIL PROTECTED]> wrote: > >>> I'm currently using RecursiveDirectoryIterator and > >>> RecursiveIteratorIterator. > >>> I'm using fwrite to w

Re: [PHP] SPL

2007-10-27 Thread Jim Lucas
Børge Holen wrote: I found this code at php.net witch needs very little modifications and can do so much, but I can't figure out how to make it read alphabeticly as mentioned $it = new RecursiveDirectoryIterator($_GET['location']); foreach (new RecursiveIterato

Re: [PHP] SPL

2007-10-27 Thread Jochem Maas
Børge Holen wrote: > On Sunday 28 October 2007 01:32:15 you wrote: >> On 10/27/07, Børge Holen <[EMAIL PROTECTED]> wrote: >>> I'm currently using RecursiveDirectoryIterator and >>> RecursiveIteratorIterator. >>> I'm using fwrite to write to a file while parsing throught the file >>> structure, >>>

Re: [PHP] SPL

2007-10-27 Thread Børge Holen
On Sunday 28 October 2007 01:32:15 you wrote: > On 10/27/07, Børge Holen <[EMAIL PROTECTED]> wrote: > > I'm currently using RecursiveDirectoryIterator and > > RecursiveIteratorIterator. > > I'm using fwrite to write to a file while parsing throught the file > > structure, > > and was wondering if i

Re: [PHP] SPL

2007-10-27 Thread Nathan Nobbe
On 10/27/07, Børge Holen <[EMAIL PROTECTED]> wrote: > > I'm currently using RecursiveDirectoryIterator and > RecursiveIteratorIterator. > I'm using fwrite to write to a file while parsing throught the file > structure, > and was wondering if it is at all possible to sort alphabetical without > goin

Re: [PHP] spl DirectoryIterator

2007-04-08 Thread Jochem Maas
Matthew Dellar wrote: > I have a problem, > > I need to turn an iterator into an array, but when I do, some methods I > need to use stop working. why do you need to turn it into an array? maybe there is an alternative? my first reaction would be that if you really need an array then you'll probab

Re: [PHP] SPL array filter

2005-09-09 Thread Robin Vickery
On 9/9/05, Kevin Waterson <[EMAIL PROTECTED]> wrote: > > Want to filter out cats from this array using SPL FilterIterator > $arr = array('koala', 'dingo', 'cat', 'Steve Irwin', 'fish'); > Why, what's wrong with cats? -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] Re: [SPAM] - RE: [PHP] SPL Countable count() not being called - Bayesian Filter detected spam

2005-08-30 Thread Chris
Justin Francis wrote: Jay Blanchard wrote: [snip] No. By implementing the Countable interface, and implementing the count() method, the global count($c) function is supposed to call $c->count(). This is so the object can be treated like a countable array in the same manner. [/snip] I was

[PHP] Re: [SPAM] - RE: [PHP] SPL Countable count() not being called - Bayesian Filter detected spam

2005-08-30 Thread Justin Francis
Jay Blanchard wrote: [snip] No. By implementing the Countable interface, and implementing the count() method, the global count($c) function is supposed to call $c->count(). This is so the object can be treated like a countable array in the same manner. [/snip] I was asleep earlierif $c

RE: [PHP] SPL Countable count() not being called

2005-08-30 Thread Jay Blanchard
[snip] No. By implementing the Countable interface, and implementing the count() method, the global count($c) function is supposed to call $c->count(). This is so the object can be treated like a countable array in the same manner. [/snip] I was asleep earlierif $c is not an array 1 will be

Re: [PHP] SPL Countable count() not being called

2005-08-30 Thread Stut
Justin Francis wrote: Stut wrote: Should it not be $c->count() ? -Stut No. By implementing the Countable interface, and implementing the count() method, the global count($c) function is supposed to call $c->count(). This is so the object can be treated like a countable array in the same

Re: [PHP] SPL Countable count() not being called

2005-08-30 Thread Justin Francis
Stut wrote: Justin Francis wrote: I have not been able to get count() to be called when I pass my Countable class to the count function. I am using PHP 5.1 Release Candidate 1. I am not sure if it is a bug, so I am posting here to see if anyone can help. -- class Col

Re: [PHP] SPL Countable count() not being called

2005-08-30 Thread Stut
Justin Francis wrote: I have not been able to get count() to be called when I pass my Countable class to the count function. I am using PHP 5.1 Release Candidate 1. I am not sure if it is a bug, so I am posting here to see if anyone can help. -- class Collection implem

RE: [PHP] SPL Countable count() not being called

2005-08-30 Thread Jay Blanchard
[snip] class Collection implements Countable { public function count() { return 200; } } $c = new Collection(); echo(count($c)); [/snip] Shouldn't this be echo Collection->count($c); or something like that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] SPL DirectoryIterator

2005-01-28 Thread Jochem Maas
Chris wrote: I'm not sure if this is a feature request, a "Oh, I didn't know that", or "That's the way it is, deal with it" kind of problem. iMHO its pretty much the last one, but I don't see the problem with what you have written, ok its a little longer, but you don't have to know that the magic