Re: [PHP] Help with Array Walk

2002-02-28 Thread DL Neil

Hello Vidyut,

>  I have a question regarding array_walk.. I couldn't find any help on
> the website or on irc.. didn't know where else to look.

You've come to the right place.

> I'm stumped, and about to just copy the function on top of this script
> to make it work.. any ideas from anyone else ?. Maybe it's something
> stupid that I'm doing.. but I can't figure it out.

Is it my imagination/cross-eyedness - how many letter-Ls should there
be?

> when I run $check->is_aetters($textfield); it works fine
> array_walk ($fieldname, '$check->is_allletters');
> Warning: Unable to call $check->is_allletters() - function does not

At least there should always be the same number!
=dn


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




RE: [PHP] Help with Array Walk

2002-02-28 Thread Ford, Mike [LSS]

> -Original Message-
> From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]]
> Sent: 28 February 2002 12:16
>
> So you want:
> array_walk ($fieldname, array($check,'is_allletters');

OOPS! Make that:
array_walk ($fieldname, array($check,'is_allletters'));

But you'd have figured that out from the syntax error message, right?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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




RE: [PHP] Help with Array Walk

2002-02-28 Thread Ford, Mike [LSS]

> -Original Message-
> From: Vidyut Luther [mailto:[EMAIL PROTECTED]]
> Sent: 28 February 2002 01:27
> 
> but when i do. 
> 
> 
> array_walk ($fieldname, '$check->is_allletters');
> 
> I get the error. 
> Warning: Unable to call $check->is_allletters() - function does not
> exist . 

RTFM: http://www.php.net/manual/en/function.array-walk.php, right near the beginning, 
contains the following:

  > Note: Instead of a function name, an array containing an object
  > reference and a method name can also be supplied.

So you want:
array_walk ($fieldname, array($check,'is_allletters');

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 


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