title: PHP Error: Undefined offset: 1
body: <p>It seems like this might be an error dealing with arrays, but I can't figure it out. I'm really just starting with PHP and this is getting to be a little intimidating.
  Any help would be greatly appreciated! here is my code:</p>
  
  <pre><code>&lt;?php echo "&lt;h1&gt;Choose a Poll!&lt;/h1&gt;";
  
  $read = file('poll_topics.txt');   
  $data = array( );           
  foreach($read as $lines){           
      list($key,$v) = explode("|","$lines");          
      $data[$key] = $v;
  }
  
  foreach ($data as $k=&gt;$desc){               
      echo "&lt;ul&gt;&lt;li&gt;&lt;a href='take_a_poll.php?poll=$k'&gt;$k&lt;/a&gt; - $desc &lt;/li&gt;&lt;/ul&gt;";
  }
  
  ?&gt;
  </code></pre>
  
  <p>Here is what is in the text file:</p>
  
  <pre><code>  Instruments|What kind of instruments do you like?
    Music|What type of music do you like best?
  </code></pre>
  
  <p>I should clarify:
  The error is line 20, or where it says <code>list($key,$v) = explode...</code></p>