title: Function name must be a string in /var/www/html/fazrin/application/controllers/file.php on line 18
body: <pre><code>class File extends CI_Controller
  {
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;helper('file');
      }
  
      function writetest()
      {
          $data = "Hello World!";
          $file= "application.DIRECTORY_SEPERATOR.test_data.DIRECTORY_SEPERATOR.helloworld.txt";
          $write_file($file,$data);
          echo "finished writing";
      }
  </code></pre>
  
  <p>This code shows the following error message in CodeIgniter:</p>
  
  <blockquote>
    <p>A PHP Error was encountered</p>
    
    <p>Severity: Notice</p>
    
    <p>Message: Undefined variable: Write_file</p>
    
    <p>Filename: controllers/file.php</p>
    
    <p>Line Number: 18</p>
    
    <p>Fatal error: Function name must be a string in
    /var/www/html/fazrin/application/controllers/file.php on line 18</p>
  </blockquote>
  
  <p>This is line 18:</p>
  
  <pre><code> $write_file($file,$data);
  </code></pre>