NYCPHP Meetup

NYPHP.org

[nycphp-talk] Second time array_walk failed for me

Phil Powell soazine at erols.com
Thu Nov 6 21:59:45 EST 2003


Well, further research yielded a solution, but leaves me with more
questions, such as:

1) Why does the PHP manual say that "array_walk" CAN change the values in
the array, when, in fact, it can't?
2) If 1 is answerable, does that mean the manual is either misleading on
array_walk, or, oh no WRONG?

Anyway I found the solution: don't use array_walk at all, use array_map
instead.  I would provide the URL to verify this but I am not sure how many
of you here at NYPHP speak fluent French for me to be able to provide it w/o
translation.  On second thought, I will anyway to verify my claims in the
belief that there are Francophones among you:
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=3E968E2C.70204%40evidian.com&rnum=5&prev=/groups%3Fq%3Darray_walk%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D3E968E2C.70204%2540evidian.com%26rnum%3D5

Thanx though

Phil



> > ----- Original Message -----
> > From: "Adam Maccabee Trachtenberg" <adam at trachtenberg.com>
> > To: <soazine at erols.com>; "NYPHP Talk" <talk at lists.nyphp.org>
> > Sent: Thursday, November 06, 2003 5:37 PM
> > Subject: Re: [nycphp-talk] Second time array_walk failed for me
> >
> >
> > > On Thu, 6 Nov 2003, soazine at pop.erols.com wrote:
> > >
> > > > I posted the code, the script, the links and the explanation on this
> > URL:
> > > > http://www.phpfreaks.com/forums/viewtopic.php?p=38181#38181 it has
> > > > everything you should need for me to explain why, for the second
time,
> > > > array_walk failed to do anything to the array element(s).
> > >
> > > Don't return the modified value; assign it to the first parameter of
> > > your callback function.
> > >
> > > -adam
> > >
> > > --
> > > adam at trachtenberg.com
> > > author of o'reilly's php cookbook
> > > avoid the holiday rush, buy your copy today!
> >
>
> -- 
> adam at trachtenberg.com
> author of o'reilly's php cookbook
> avoid the holiday rush, buy your copy today!




More information about the talk mailing list