function strsToArray($strs) {
$result = array();
$array = array();
$strs = str_replace(‘,‘, ‘,‘, $strs);
$strs = str_replace("n", ‘,‘, $strs);
$strs = str_replace("rn", ‘,‘, $strs);
$strs = str_replace(‘ ‘, ‘,‘, $strs);
$array = explode(‘,‘, $strs);
foreach ($array as $key => $value) {
if (‘‘ != ($value = trim($value))) {
$result[] = $value;
}
}
return $result;
}
本文出自 “PHP/Linux@HeFei” 博客,请务必保留此出处http://liang3391.blog.51cto.com/178205/1976281
原文:http://liang3391.blog.51cto.com/178205/1976281