Manipulation of an array

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yoda69
Forum Newbie
Posts: 16
Joined: Wed Jun 20, 2007 10:21 am

Manipulation of an array

Post by yoda69 »

Hey all,
I'm using an array to populate labels for a graph. When I have a lot of keys in the array (user answered a questionnaire many times) there are too many labels in graph and it does not look good.
I want to limit the number of key in the array to 15.
Do you have any ideas about good ways to manipulate the array but leaving the 1'st and last values, and choosing interval keys between them?

Or do you think it will be simpler to do this on mysql level?
Thanks,
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Manipulation of an array

Post by requinix »

Maybe you want to set up the graph so that it displays, for instance, every other key (or every third, or fourth, or at most X keys and it figures out how many to skip automatically, or whatever the graph thing is capable of).
Post Reply