View Full Version : Random order includes from directory

06-15-2010, 11:17 PM
Hi all,

I'm new to these forums, and extremely new to php coding in general. My role is primarily a front-end developer (html / css) and a bit of php in the form of includes to manage recurring content and so forth.

My question is probably convoluted so if my thinking is flawed, please let me know.

I'm using a jquery content slider. It pulls from a <ul> and loads each <li> as an individual slide.

What I would like to do is use php includes for each <li> (some inline css, and html) and have them load in a random order using a single script.

Something like this...

<!--content slider begins-->
<?php include("RANDOM-LOADER-SCRIPT.php"); ?>
<!--content slider ends-->

Where RANDOM-LOADER-SCRIPT reads a directory of snippets (subfolder/snippet1.php, snippet2.php and so on) and includes ALL of them into the <ul> in a random order, without repeats.

Thanks much!

06-15-2010, 11:47 PM
Thanks to Phoenix over on webforumz.com