How do I randomise the contents returned in a foreach loop
Posted: Wed Sep 23, 2009 12:12 pm
I am using cgsimple within a foreach loop to pull data from multiple pages and I need to randomise the output.
i.e. Say there are 10 pages and I need to show the contents of 4 but which 4 need to be randomised and of course it cannot show the same page content more than once. Also ideally the number should not be sequential i.e. it can show data in the order of page 5, 2, 9, 6.
Any ideas greatly appreciated.
i.e. Say there are 10 pages and I need to show the contents of 4 but which 4 need to be randomised and of course it cannot show the same page content more than once. Also ideally the number should not be sequential i.e. it can show data in the order of page 5, 2, 9, 6.
Any ideas greatly appreciated.