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
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello All,
It seems to me that an instance of RecursiveIteratorIterator with ArrayObject
has no effect
when calling RecursiveArrayIterator::offsetUnset or
RecursiveArrayIterator::offsetSet methods.
But everything works fine when the iterator is created with a json_decoded -
json_encoded array.
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
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($
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
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
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['
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
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
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,
>>>
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
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
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 going
all array. That seems to me like doing the job twice over. Atl
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
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.
Take a look at the following example:
$dir = 'c:/';
$files = new DirectoryIterator($dir);
//$files = iterator_to_array($files);
foreach ($files as $file) {
echo "{$file->get
I'm going to try my best to explain what I'm trying to do.
I have my own class that has an array member. This class itself implements
Iterator. One of the fields in the array is itself an array that I would
like to iterate over. Here's some code:
class Folio implements Iterator {
$projects = ar
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
Want to filter out cats from this array using SPL FilterIterator
$arr = array('koala', 'dingo', 'cat', 'Steve Irwin', 'fish');
kind regrards
Kevin
--
"Democracy is two wolves and a lamb voting on what to have for lunch.
Liberty is a well-armed lamb contesting the vote."
--
PHP General Mailin
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
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
[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
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
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
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
[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:
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 implements Countable
{
public
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
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.
foreach(new DirectoryIterator($sDir) as $oFile)
{
if($oFile->isDot() || 'hidden.txt' == $oFile->getFilename()) continue;
echo $oFile,"\n";
}
In the code above, I a
Does anyone know when the exception objects listed in
item #6 at http://www.php.net/~helly/php/ext/spl/ will be available
in base php5??
Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
30 matches
Mail list logo