-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 oops....forgot the &. array_walk($myarray, array(&$this, 'DoArrayStuff'),1);
On Wednesday 30 October 2002 02:38 pm, Paul Nicholson wrote: > try(untested): array_walk($myarray, array($this, 'DoArrayStuff'),1); > HTH! > ~Paul > > On Wednesday 30 October 2002 02:08 pm, PHP List wrote: > > I think the fog is starting to clear, thanks for the help. > > > > I do have one more question: > > If I want to use array_walk in a class, how do I refer to a function in > > that class? > > > > Class MyClass > > { > > . > > . > > . > > function DoArrayStuff(&$item1, $key, $nMode) > > { > > echo $item1; > > } > > function SomeOtherFunction > > { > > . > > . > > $myarray already filled with, say, 5 items; > > array_walk($myarray,'DoArrayStuff',1); <--- PHP error: > > DoArrayStuff() - function does not exist in . . . > > > > I have tried 'MyClass::DoArrayStuff', 'this->DoArrayStuff', > > '$this->DoArrayStuff' but none work. > > The only way I can seem to use DoArraySuff is to define the > > funcion seperate(outside) from the class, which seems kind of odd since > > the only time the function is needed is internally by this class. > > } > > > > } - -- ~Paul Nicholson Design Specialist @ WebPower Design "The web....the way you want it!" [EMAIL PROTECTED] "It said uses Windows 98 or better, so I loaded Linux!" Registered Linux User #183202 using Register Linux System # 81891 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9wDlTDyXNIUN3+UQRAtztAJsEDcpul5+59W4SBkix48bjjPQ/dQCgmtnk rt2kPQqufaW1yoFDrizoHeQ= =cBGo -----END PGP SIGNATURE----- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php