在textarea中处理额外的行

please help...users are pasting values in textarea which results to adding a new line...that new line is being processed and being uploaded to db but does not have values on some columns...how can i eliminate the extra lines prior to processing the textarea and upload to db?

here is my code that process the textarea into arrays:

$PhoneNumber = array_map('mysql_real_escape_string', explode("
", $_POST['PhoneNumber']));
$Createdate = array_map('mysql_real_escape_string', explode("
", $_POST['Createdate']));
$RemedyTicketNo = array_map('mysql_real_escape_string', explode("
", $_POST['PhoneNumber']));

//Determine the values with the least amount of elements

$min_count = min(count($PhoneNumber), count($Createdate), count($RemedyTicketNo));

//Create array to hold INSERT values

$values = array();

//Create the INSERT values

for($index=0; $index<$min_count; $index++)
{
$values[] = "('{$RemedyTicketNo[$index]}','{$PhoneNumber[$index]}','{$Createdate[$index]}',
'$Category2','$Category3','$Status','$Date','$Severity','$BanType','$XiD')";   
}

//inserting to db

if (isset($RemedyTicketNo)) 
{
$sql="INSERT into tbl_main
(ars_no,phone_number,create_date,category_1,category_2,status,resolved_date,trouble_type_priority,ban_type,employee_id_name)
VALUES " . implode (',',$values); 
$result=mysql_query($sql);

im trying to incorporate this code...but its just doesn't seem to work...

$lines = preg_split('/
+/', trim($_POST['textarea']));
$text = implode("
", $lines);

here's how my code looks like when i modify it with the code above:

$PhoneNumber = preg_split('mysql_real_escape_string', '/
+/', trim("
", $_POST['PhoneNumber']));
$Createdate = preg_split('mysql_real_escape_string', '/
+/', trim("
", $_POST['Createdate']));
$RemedyTicketNo = preg_split('mysql_real_escape_string', '/
+/', trim("
", $_POST['PhoneNumber']));


if (isset($RemedyTicketNo)) 
{
$sql="INSERT into tbl_main
    (ars_no,phone_number,create_date,category_1,category_2,status,resolved_date,trouble_type_priority,ban_type,employee_id_name)
VALUES " . implode ('
',$values); 
$result=mysql_query($sql);

this was fixed already...i just re-edited the codes above and only add trim and it worked:

$PhoneNumber = array_map('mysql_real_escape_string', explode("
", trim($_POST['PhoneNumber'])));
$Createdate = array_map('mysql_real_escape_string', explode("
", trim($_POST['Createdate'])));
$RemedyTicketNo = array_map('mysql_real_escape_string', explode("
", trim($_POST['PhoneNumber'])));