How to get a list from txt file and explode it in PHP? : <p>Hi I have a txt file like this:</p>

<pre><code>lenovo,pc,mouse
mac,pc,mouse
dell,pc,mouse
</code></pre>

<p>and I want to make a drop down list of first part of txt file string (pc name). Here is my code but it doesnt work how I want. It doesnt explode it. Any help? </p>

<pre><code>echo "Which pc are you using?? &lt;br&gt;";   
$pc = file('pc.txt');
$name = ' ';
$name.="&lt;option&gt;Choose please&lt;/option&gt;";
foreach ($pc as $type) { 
    $name .= '&lt;option value="'.$type.'"&gt;'.$type.'&lt;/option&gt;';
explode(',',$name);}
$select = '&lt;select name="pc"&gt;'.$name.'&lt;/select&gt;';
echo $select;
</code></pre>
