$symptom_list = preg_replace("/\ +/", '', $_POST['symptom']); //将获得的值里面的空格去除 $symptom = preg_replace("/[\r\n]+/", '|', $symptom_list); //将值里面的换行转换成|