readfile() says it outputs the content but I want the content to be saved in a variable. How do I do that? I tried $content=readfile(\"file.txt\") but that doesn\'t come out
readfile() writes the contents of the file to a buffer. Use file_get_contents() instead.