Hi, im creating a website at the moment and i want to use this php code to create random effects on my page when its refrshed. Im using this php code which enetrs random text into a web page stored rom a flat file. Can any one help me, and customise it further so a corresponding image and even a link can be displayed as well.
<?php
$RANDOM_TXT_FILE = "sample_data.txt";
srand((double)microtime()*1000000);
if (file_exists($RANDOM_TXT_FILE)) {
$arry_txt = preg_split("/--NEXT--/", join('', file($RANDOM_TXT_FILE)));
echo $arry_txt[rand(0, sizeof($arry_txt) -1)];
} else {
echo "Error: can't open $RANDOM_IMG_FILE file";
}
?>
Man.y thanks