I have a text file, named as "random.txt" with the content as like this:
Now in my php file, I want to randomly select & display two titles (with respective link) as like this:
<?
$textfile ="random.txt";
$items = file("$textfile");
shuffle ($items);
echo "RandLink1 : " . $items[0];
echo "<br>RandLink2 : " . $items[1];
?>
***
The result is showing as required by me. But I want to load the text file (random.txt) as like this only :
If I load this text file as like above (writing only the link and title names in the file), then what will be the php code to display two random titles on the result page?
Thanks for your kind help.