how to use array_walk

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I dont get how to use array_walk.

I'd like to do something like
$ra = array_walk($ra,'esc');

function esc($str){
    return mysql_real_escape_string($str);

and have all the values in $ra escaped.
but that doesnt seem to be working.

Looks like i'm sposed to have (&$str) for my func's param...But i'm not sure how
that affects other vars that are passed to the func in the normal way.
( $somestring = esc($somestring);)

thanks for your time

Re: how to use array_walk

J. Frank Parnell wrote:
Quoted text here. Click to load it

You need to pass the string as a reference, and change the reference
(not return the value).

See the first example at .

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline