PHP explode, newlines and you

If you want to split (explode) a string into an array using a newline as separator, explode() is NOT the tool to use. You may end up with strings that still include a newline or carriage return (specially if your users enter data using a windows machine). You may end up with "An invalid choice has been detected. Please contact the site administrator." if you are using this to create select option keys and values.

SO rather than using:

$values = explode("\n", $value_string);

Use a safer method like:
$values = preg_split('/[\n\r]+/', $value_string);