Fairly simple once you understand how the form data is sent. You need to take advantage of PHP's array handling for this. Set out a form like below... (I have used the POST method but you could use GET)
Code:
<form action="somepage.php" method="POST">
<select name="values[]" multiple="multiple">
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
</select>
<input type="submit" value="Submit" />
</form>
Notice how I called the select name values[] (with the brackets), when data is sent PHP actually parses this as an array. For example, if I select option1 and option3 from the select box, the data PHP gets is:
values[]=option1&values[]=option3
Which when accessed by PHP is:
$_POST['values'][0] = 'option1';
$_POST['values'][1] = 'option3';
Because the arrays are indexed starting at 0, you can use a for loop to loop through all the values and insert them into the database/file, easy eh!