title: Perform a mathematical operation after retrieving from another file
body: <p>I have a text file (math.txt) in which any kind of arithmetic operation could be written. I have to read the file using PHP and determine the output. I am using the below mentioned code to read the content of the file.</p>
  
  <pre><code>$file = 'math.txt';  // 2+3 is written in math.txt
  
  $open = fopen($file, 'r');
  
  $read = fgets($open);
  $close = fclose($open);
  </code></pre>
  
  <p>Using the above code, i am getting the content. But echoing the content is displaying the original content (i.e 2+3) rather than displaying the output(i.e 5). I am not understanding what should i do in this case. </p>
  
  <p>Any help on this will be appreciated. Thanks in advance.</p>