Hi I have a txt file like this:
lenovo,pc,mouse
mac,pc,mouse
dell,pc,mouse
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?
echo "Which pc are you using?? <br>";
$pc = file('pc.txt');
$name = ' ';
$name.="<option>Choose please</option>";
foreach ($pc as $type) {
$name .= '<option value="'.$type.'">'.$type.'</option>';
explode(',',$name);}
$select = '<select name="pc">'.$name.'</select>';
echo $select;