I have a code like this. but the problem is why can't output ... please give suggestions, what is wrong with this code
<?php
function randLine($fileName) {
$fh = @fopen($fileName, "r");
while (true) {
$line = fgets($fh);
if ($line == null) {
break;
}
}
fclose($fh);
return $line;
}
$tes = randLine("list.txt");
$tes = str_replace(array("
", ""), "", $tes);
echo $tes;