Re: Manipulating in array Uses for Arrays
To show you how useful arrays are when you need to store and retrieve information, I have put together an example that demonstrates their power and usefulness. Imagine that you have an online store selling computer components, and you offer five products out of five of your product lines as special offers every week. Obviously there is only so much information you can fit onto your homepage, so you can’t show all 25 of the week’s special offers at once. But because you want to alert people that these offers exist, you need something on the homepage.
You decide that a random image generator would be your best use of space, and you want it to display one offer from each of the product lines at a time. You want each of the images to be a roll-over, the staple of any wholesome website. Each of the images should also link to a new page, giving the full description and details of each of the products. All of a sudden there is an incredible amount of information that your script is going to need to use; an array is going to be needed to keep track of it -- several arrays in fact.
__________________ With,
J. Jeyaseelan Everything Possible |