bradgrafelman wrote:Use [man]file/man to read the file into an array of lines, then it's easy to echo a specific line:
$lines = file('file.txt');
echo $lines[305]; // echo's contents of line 306
There's a problem with that. I get this error message:
Warning: file($handle): failed to open stream: No such file or directory in /home/pwnedbyj/public_html/bulletins/original.php on line 8
Line eight being this:
$source = file('$handle');
I guess it only reads text files created in the directory, not variables like I'm using. If I used the file function, then I would have to make something where it creates the source code text file in the same directory, and all of that junk that I don't want to deal with. If you would like to code that all for me, be my guest, but I'm looking for something simpler, like just using the fread function.
Can you explain to me why fread will only take a certain file size, not unlimited like I want it to?