Of course, you will have to read in the file first, preferably in an array.
To read a file in an array, you just need the file() function:
$lines = file('quotes.txt');
Then, you shuffle the array with shuffle() function that randomizes all the items in the array thus shuffling the lines in the file quotes.txt:
$lines = shuffle($lines);