将逗号,空格,回车,|,分隔的字符串转换为数组
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;
}
文章题目:将逗号,空格,回车,|,分隔的字符串转换为数组
本文URL:http://azwzsj.com/article/pgghhs.html