Code: Select all
// insert random block from a text file. it is inserted as-is,
// so be careful. :)
//
// place a ~ between blocks in file being randomyzed, like this:
//
// <h2>one</h2>
// <p>some text</p>
// ~
// <h2>two</h2>
// <p>some other text</p>
// ~
// <h2>three</h2>
// <p>third time is the charm</p>
//
// without first and last lines below, would be suitable for non
// content applications, e.g. randomyzing stylesheets.
echo "<div id=\"randomyze\">";
$c_myze = join ('', file ('./uploads/randomyze_data.txt'));
$s_myze = split("~",$c_myze);
$n_myze = rand(0,(count($s_myze)-1));
echo $s_myze[$n_myze];
echo "</div>";
one of those 'works for me and YMMV' things.

sample data file attached.
[attachment deleted by admin]