- <?php
- //返回字符串中的所有單詞 $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]); //Vevb.com
- return $match[1];
- }
- ?>
- //取得所有鏈接
- <?
- function get_all_url($code){
- preg_match_all('/<as+href=["|']?([^>"' ]+)["|']?s*[^>]*>([^>]+)</a>/i',$code,$arr); //osphp.com.cn
- return array('name'=>$arr[2],'url'=>$arr[1]);
- }
- ?>
新聞熱點
疑難解答