php-general | 2001122
Date: 12/21/01
- Next message: K Old: "[PHP] PostgreSQL query taking a long time"
- Previous message: Jerry: "[PHP] MSSQL DB Connect"
- In reply to: Jeff Levy: "[PHP] array_walk() + class methods"
- Next in thread: Jeff Levy: "Re: [PHP] array_walk() + class methods"
- Reply: Jeff Levy: "Re: [PHP] array_walk() + class methods"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
array_walk($ar, array(&$object, 'methodname'));
----- Original Message -----
From: "Jeff Levy" <php4 <email protected>>
To: <php-general <email protected>>
Sent: Thursday, December 13, 2001 1:17 PM
Subject: [PHP] array_walk() + class methods
| I'd like to call a class method with array_walk(). Is this possible?
|
| class widget {
| function sicballs($arg){
| print $arg;
| }
| }
|
| $x = new widget();
|
| $ar = array('my','values');
|
| array_walk($ar, ???)
|
| ...
|
| the only way I've been able to get this (simplified) code to work the way
| I want it is:
|
| function snafu($arg) {
| global $x;
| call_user_method("sicballs", $x, $arg);
| }
|
| obviously, I want to call the method direcly, without writing this
| function, snafu()...
|
| anyone know?
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: php-general-unsubscribe <email protected>
| For additional commands, e-mail: php-general-help <email protected>
| To contact the list administrators, e-mail: php-list-admin <email protected>
|
- Next message: K Old: "[PHP] PostgreSQL query taking a long time"
- Previous message: Jerry: "[PHP] MSSQL DB Connect"
- In reply to: Jeff Levy: "[PHP] array_walk() + class methods"
- Next in thread: Jeff Levy: "Re: [PHP] array_walk() + class methods"
- Reply: Jeff Levy: "Re: [PHP] array_walk() + class methods"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

