How to convert text area data into select list in forms? I want to create a configurable select list in forms.To achieve this what I did is I have created a text area, in that I will enter values like:

HI|Hi
BYE|Bye


So, in form select options I have to use these values in a dropdown list. How can I achieve that. I am getting this text area data in form like below.Here I am getting data, but not displaying in the options. 

$entityoptions = variable_get('entitydropdown'); 


I am getting the values as it is, but am not getting how can I assign these  values to #options. I did like below but its not displaying the values. 

'#options' =&gt; $entityoptions,


Please help me to identify, where I am doing wrong. Thanks in advance.
As requested in the comments, in answer format:


Use the explode() function on your string
Loop through the results and split each entry
Add the result to the options array you feed to the select box


Eg.

$options = array();
$lines = explode(PHP_EOL, $entityoptions);
foreach($lines as $line) {
  $line = explode('|', $line);
  $options[$line[0]] = $line[1];
}