title: Open text file read comma separated values
body: <p>I have the following code:</p>
  
  <pre><code>$pollids  = "pollids.txt";
  $contents = file_get_contents($pollids);
  list($pollid) = explode(',', $contents);
  echo $pollid;
  </code></pre>
  
  <p>This opens a text file containing a comma separated list of text: value1,value2,value3 etc...</p>
  
  <p>However it only echo's the first piece of text in the file. How can I get it to loop/fetch them all?</p>
  
  <p>Secondly, once I have these values, perhaps stored in an array, can i feed them into this piece of script?</p>
  
  <pre><code>$summize = new summize;
  $search = $summize-&gt;search('searchterm');
  $text = $search-&gt;results[0]-&gt;text;
  </code></pre>
  
  <p>So that ('searchterm') is replaced by each value in the file? Again i suspect some kind of loop within a loop?</p>