Member Avatar for kirtan_thakkar

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..

Member Avatar for kirtan_thakkar

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');
Member Avatar for kirtan_thakkar

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.