I have 2 long arrays of items, say 20 or so, as a constant items included on a page.
On individual pages I want to use another array to take the values from a certain number of positions (the same) within both constants.
If I had the ability to use sql in this instance it would be easy but I do not have that luxury.
eg
//constant arrays
$numbers (1, 2... 19, 20);
$alphabeticalFood (apple, banana... sausage, tramploine);
//Choice array
$selector (1, 3, 5)
Something something
Output:
2 4 6 //(135 would be nicer)
banana durian frankfurter //(again apple, carrot, egg would be preferable)
I have tried with foreach’s and thought about multidimensional arrays but frankly my little brain gets lost.
Anyone got any good ideas or a nice little function that will do the job?