title: how do I assign content from readfile() into a variable?
body: <p>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 right. </p>
  
  <p>I want to do like this:</p>
  
  <pre><code>$data=readfile("text.txt");
  echo htmlentities($data);
  </code></pre>
  
  <p>That should give you an idea of how I want that to work. </p>