Brent -- ...and then Brent Baisley said... % % Unless the user has a lot of baskets, I would assume you would just list % all the baskets the user has as links on the web page or as a pop up
One never knows, but I currently list as many as he has anyway.
% menu. The value passed by the links or pop up would be the element
% number of the array item containing the desired basket.
OK... Then, of course, I'd have to do name->number mapping so that I can
present the surfer with the name that he chose rather than just a number,
but that could be done, too.
% To extract a basket by name I would say you could use array_search, but
% in looking into that function it appears to have changed through recent
% versions of PHP. In PHP 4.1 it doesn't search multi-dimensional arrays,
% I'm not sure about in 4.2.
Makes it trickier :-)
%
% But it's easy enough to create your own function to search the array.
Right.
% And you are right, the setup I recommended can get a bit kludgy. But if
% you "denormalize" the array structure it can get easy again. Just make
% the first element for each basket the name of basket.
% $baskets[] = array("basketname1","item1","item2");
% $baskets[] = array("basketname2","item1","item2","item3");
% $baskets[] = array("basketname3","item1","item2",...);
Hmmm... I tried something like this and it got ugly. I could try again,
except now it looks like I won't have to.
%
% You can use sort() to sort the array.
Right.
%
% Hope that helps and sorry about steering you down the difficult path
% first.
It's quite informative, and I still need a lot of that, and the tough
path is no problem :-) Thanks for all of the input!
HAND
:-D
--
David T-G * There is too much animal courage in
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg94209/pgp00000.pgp
Description: PGP signature

