Member Avatar

I need a php code that will open and show a random text file(something.txt) in the webpage.I found so many scripts that open a random line in one textfile but i need a code in php that will open a random .txt format file in a specific folder to see on a web page.
Please help..

Re: Open a random text file from the folder.. 80 80
Member Avatar

I use this code for reading a text file..
But it shoud have to be a random file..
Help me to create that...

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');
Re: Open a random text file from the folder.. 80 80
Member Avatar

I use this code for reading a text file..
But it shoud have to be a random file..
Help me to create that...

$myFile = "testFile.txt";
$fh = fopen($myFile, 'r');

I have done it myself....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.