function _unique($str){
preg_match_all('/([a-zA-Z]+)/',$str,$_arr);
$_arr[1]=array_unique($_arr[1]);
sort($_arr[1]);//sort()将数组小标重新排列
return $_arr[1];
}
$str='abc def abc eft';
print_r(_unique($str));
function _unique($str){
preg_match_all('/([a-zA-Z]+)/',$str,$_arr);
$_arr[1]=array_unique($_arr[1]);
sort($_arr[1]);//sort()将数组小标重新排列
return $_arr[1];
}
$str='abc def abc eft';
print_r(_unique($str));
转载于:https://my.oschina.net/myroot/blog/105027