(.*?)<\/title>/si', $result, $match) > 0) { $channel_title = $match[1];} if (preg_match('/"/si', $result, $match) > 0) { $channel_desc = $match[1];} if ($channel_desc == "") $channel_desc = $url; $title = wsstrip($channel_title); $result = preg_replace("']*>.*'siU",'',$result); $result = preg_replace("']*>.*'siU",'',$result); $str= strip_tags($result); $str2= explode("\n",$str); foreach($str2 as $key => $value){ $str2_len[$key] = strlen($value); } array_multisort($str2_len, SORT_DESC, SORT_NUMERIC, $str2); $description =trim(shorten($str2[0],100)); //$description=utf8_encode($description); /////////////////////////////////////////////// header("Content-Type: text/xml"); $output =""; $output .= "\n"; $output .= "\n"; $output .= "\n"; $output .= "\n"; $output .= "". htmlentities(strip_tags($link)) ."\n"; $output .= "". htmlentities($link) ."\n"; $output .= "The RSS feed of ". htmlentities(strip_tags($channel_title)) ." at ".$link." \n"; $output .= "". htmlentities("artikels@mowspace.co.za") ."(Godfrey Philander)\n"; $output .= "". htmlentities("RSSIT") ."\n"; $output .= "en\n"; $output .= "\n"; $output .= "". htmlentities($title) ."\n"; $output .= "". htmlentities($url) ."\n"; $output .= "". htmlentities($description)."\n"; $output .= "\n"; $output .= "\n"; $output .= "\n"; print $output; //////////////////////////////////////////// function shorten($string,$maxWords,$end=NULL) { if (!isset($end)) { $end = ''; } $temp = explode(' ',$string); for ($i=0; $i<$maxWords; $i++) { $temp2[] = $temp[$i]; } $endResult = implode(' ',$temp2).$end; unset($temp,$temp2); return $endResult; } function wsstrip($str) { $str=ereg_replace("[\r\t\n]"," ",$str); $str=ereg_replace (' +', ' ', trim($str)); return $str; } ?>