Re: [PHP] array_walk, or array_map, or foreach?

2006-10-20 Thread Robert Cummings
On Fri, 2006-10-20 at 16:04 +0900, Dave M G wrote: > PHP List, > > I took a snippet of code right off the php.net site to use trim on all > the elements of an array. > > Theoretically, it should test if the element in an array is in turn > another array, and break it down to the next level unti

[PHP] array_walk, or array_map, or foreach?

2006-10-20 Thread Dave M G
PHP List, I took a snippet of code right off the php.net site to use trim on all the elements of an array. Theoretically, it should test if the element in an array is in turn another array, and break it down to the next level until it gets to a string it can use trim on. This is the code:

Re: [PHP] Array_Walk error messages

2004-11-07 Thread Curt Zirzow
* Thus wrote Stuart Felenstein: > Can anyone give me a clue what I have done wrong here. > > //These would be passed as ints: > array_walk($l_industry, 'mysql_escape_string'); > Warning: Wrong parameter count for > mysql_escape_string() in > /xxx//public_html/Test2.php on line 104 > The call

[PHP] Array_Walk error messages

2004-11-07 Thread Stuart Felenstein
Can anyone give me a clue what I have done wrong here. //These would be passed as ints: array_walk($l_industry, 'mysql_escape_string'); Warning: Wrong parameter count for mysql_escape_string() in /xxx//public_html/Test2.php on line 104 //These would be passed as ints: array_walk($l_tterm, 'my

Re: [PHP] array_walk

2002-06-06 Thread Dan Hardiker
> Instead of passing "this" and "other" to your array, PHP > passes "0" and "other". Is there any way I can make it > so that it passes "this"? [pulled from the manual directly] Example 1. array_walk() example $fruits = array ("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); funct

[PHP] array_walk

2002-06-06 Thread Chris Boget
If you use array_walk with an associative array, the only arguments that PHP automatically passes to the defined array are the numerical/element keys. Is there any way you can force it to pass the associative keys? For example, I have an array: $bob = array( "this" => "other" ); Instead of pas

Re: [PHP] array_walk inside class method

2002-01-22 Thread S. Murali Krishna
Dear Gyozo You have sent me the following solution thru php mailing list. I have also asked you a doubt about the syntax. I want to explain this syntax to my colleagues, could u pls point me to any documentation of this syntax or any article. if possible pls explain y

Re: [PHP] array_walk inside class method

2002-01-07 Thread S. Murali Krishna
Hi Thanks for ur help. Its Working but I couldn't understand the syntax given by u can u explain pls. Thanks again. On Sun, 6 Jan 2002, Gyozo Papp wrote: > it may be better: > > array_walk($this->array, array(&$this, 'func1'); > > "Attila Strauss" <[EMAIL PROTECTED]>

Re: [PHP] array_walk inside class method

2002-01-05 Thread Gyozo Papp
it may be better: array_walk($this->array, array(&$this, 'func1'); "Attila Strauss" <[EMAIL PROTECTED]> wrote in message 001d01c195db$67647da0$[EMAIL PROTECTED]">news:001d01c195db$67647da0$[EMAIL PROTECTED]... | hi | | $this->func1(); | | | best regards | attila | | | > | >

Re: [PHP] array_walk inside class method

2002-01-05 Thread Attila Strauss
hi $this->func1(); best regards attila > > > Hi All, > I want to use "array_walk" function inside a class method. But the > problem is i want the second argument to array_walk ( function name ) > be a another function of the same class. when i gave like that its telling > > Error : function n

[PHP] array_walk inside class method

2002-01-05 Thread S. Murali Krishna
Hi All, I want to use "array_walk" function inside a class method. But the problem is i want the second argument to array_walk ( function name ) be a another function of the same class. when i gave like that its telling Error : function not exist. class some() { function func

Re: [PHP] array_walk() + class methods

2001-12-22 Thread Jeff Levy
Much obliged, that did the trick. On Fri, 21 Dec 2001 05:48:31 -0500, Papp Gyozo wrote: > array_walk($ar, array(&$object, 'methodname')); > > - Original Message - > From: "Jeff Levy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> > Sent

Re: [PHP] array_walk() + class methods

2001-12-21 Thread Papp Gyozo
array_walk($ar, array(&$object, 'methodname')); - Original Message - From: "Jeff Levy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, December 13, 2001 1:17 PM Subject: [PHP] array_walk() + class methods | I'd like to

[PHP] array_walk() + class methods

2001-12-19 Thread Jeff Levy
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

[PHP] array_walk() and class methods

2001-12-19 Thread php4
i have class instance snagfu, of class snafu, with a method, fubar() i have an array, $tarfu, and want to run it through array_walk(), array_walk($tarfu, $snagfu->fubar) seems to be logical, if it's possible. this obviously doesn't work. How do i use a class method with array walk? or is it e

[PHP] array_walk in obejct

2001-12-11 Thread marcbey
hi, whats about using the array_walk function within an object? php says that there is no callback function. do you have an idea? thx, marcbey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To cont