title: Possible improvements for an OO PHP written script
body: <p>Okay, I am wanting to expand my armoury within PHP, so I've been researching OO PHP. With my researched knowledge I went on to create a quick script that reads a CSV file and outputs the results. </p>
  
  <p>CSV Class: </p>
  
  <pre><code>class CSV {
  
      private $file; 
  
      public function __construct($filename, $mode) {
          $this-&gt;file = fopen($filename, $mode); 
      }
  
      public function endFile() {
          return feof($this-&gt;file); 
      }
  
      public function getCSV($mode) {
          return fgetcsv($this-&gt;file, $mode);
      } 
  
      public function close() {
          fclose($this-&gt;file); 
      }
  }
  </code></pre>
  
  <p>The test file: </p>
  
  <pre><code>require('class.csv.php');
  
  $csv = new CSV('postcodes.csv', 'r'); 
  
  while(!$csv-&gt;endFile()) {
  
      $postcode = $csv-&gt;getCSV(1024); 
      echo $postcode[0] . "&lt;br /&gt;"; 
  
  }
  
  $csv-&gt;close();
  </code></pre>
  
  <p>I am just wondering if there are... or what are the improvements I could make in regards to the OO approach. This is purely a script for me to put the knowledge i've learnt together. I'm not another 'following the crowd person' who creates every script in an OO approach because they 'can'. </p>
  
  <p>I understand it is a short script but I am wanting to make sure I have the correct approach before moving forward. </p>