Open text file read comma seperated values

supahfly

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