Tutorial Random Slogan Displayer

by in , 0

Create a text file called slogans.txt with permissions that it can be read by the server. Put each slogan on a different line, e.g.:

Building websites since before there was a web.
The internet is for lovers.

<?php
       $f_contents = file ("slogans.txt");
       $line = $f_contents[array_rand ($f_contents)];
       print $line;
?>

Leave a Reply