[PHP] Help with using SPL to build a MySQL Iterator

2005-05-18 Thread V Kam
Hello all

I was trying to write an SPL Iterator for a MySQL
result set but not having any luck. Specifically I'm
not sure how to overload the key() and current/next()
methods. 

Does anyone here have a working code sample that does
this, or can offer some guidance on how to overload
the 5 Iterator methods? Any assistance much
appreciated!

Thanks!



__ 
Do you Yahoo!? 
Read only the mail you want - Yahoo! Mail SpamGuard. 
http://promotions.yahoo.com/new_mail 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Using a recursive ArrayIterator

2005-02-03 Thread V Kam
Hello all

I need some assistance converting code to use the
RecursiveIterator in PHP 5 SPL. I have the following
function which scans through a nested array set and
returns the path to all matches.

$value)
{
$path .= "$key/";

// unset the path once the end of the tree is
reached
if (is_array($value)) 
{
arraySearchRecursive($needle, $value, $path);
unset($path);
} 

else 
{
echo $path;
}
}
}
?>

I'm trying to convert this to use iterators as I
believe that may be faster/more efficient. However I'm
totally confused as to how to do it given the large
number of interfaces/classes and lack of
documentation. Could someone knowledgeable on the list
help me get started? Ideally I'd like a
framework/outline in pseudocode.

Thanks!

Kam




__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php