将逗号,空格,回车,|,分隔的字符串转换为数组
functionstrsToArray($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($arrayas$key=>$value) {
if(''!= ($value= trim($value))) {
$result[] =$value;
}
}
return$result;
}
网页题目:将逗号,空格,回车,|,分隔的字符串转换为数组
文章出自:http://pwwzsj.com/article/pgghhs.html