【www.gdgbn.com--excel】

//返回字符串中的所有单词 $distinct=true 去除重复

function split_en_str($str,$distinct=true) {
preg_match_all("/([a-za-z]+)/",$str,$match);


        if ($distinct == true) {
$match[1] = array_unique($match[1]);
        }
sort($match[1]); //osphp.com.cn
        return $match[1];
}
?>

//取得所有链接

function get_all_url($code){ 
preg_match_all("/"" ]+)["|"]?s*[^>]*>([^>]+)/i",$code,$arr);  //osphp.com.cn
        return array("name"=>$arr[2],"url"=>$arr[1]); 
}
?>

本文来源:http://www.gdgbn.com/bangongshuma/28911/