title: PHP Notice: Undefined offset: 1 with array when reading data
body: <p>I am getting this PHP error:</p>
  
  <pre><code>PHP Notice:  Undefined offset: 1
  </code></pre>
  
  <p>Here is the PHP code that throws it:</p>
  
  <pre><code>$file_handle = fopen($path."/Summary/data.txt","r"); //open text file
  $data = array(); // create new array map
  
  while (!feof($file_handle) ) {
      $line_of_text = fgets($file_handle); // read in each line
      $parts = array_map('trim', explode(':', $line_of_text, 2)); 
      // separates line_of_text by ':' trim strings for extra space
      $data[$parts[0]] = $parts[1]; 
      // map the resulting parts into array 
      //$results('NAME_BEFORE_:') = VALUE_AFTER_:
  }
  </code></pre>
  
  <p>What does this error mean?  What causes this error?</p>