I actually know this one!!! (not that I wrote it lol)
Code:
<?php
$file = "/home/domain.com/public_html/textfile.txt";
$banners = file($file);
srand((float) microtime() * 1235689);
$selected = array_rand($banners);
$SelBanner = trim($banners[$selected]);
if ($SelBanner=="") {
$SelBanner = trim($banners[0]);
};
echo $SelBanner;
?>
That will pull 1 line from the text file & insert it on the page. I've used it as a cheap banner rotator for years:
https://www.link-o-rama.com/greenguy/mlinks.htm