#', '', $excerpt_base);
$text = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $text);
$length = (isset($count)) ? $count : 3;
$style = (isset($type)) ? $type : 'sentences';
switch ($style) :
case 'words' :
$short = array_slice(explode(' ', $text), $offset, $length);
$output = trim(implode(' ', $short));
break;
case 'sentences' :
$short = array_slice(preg_split("/([\t.!?:]+)/", $text, -1, PREG_SPLIT_DELIM_CAPTURE), $offset*2, $length*2);
$output = trim(implode($short));
break;
case 'letters' :
$output = substr($text, $offset, $length);
break;
default :
$output = $text;
endswitch;
endif;
endif;
if (!empty($linespace)) :
$short=preg_split("/([\t.!?:]+)/", $output, -1, PREG_SPLIT_DELIM_CAPTURE);
$short[count($short)] = '';
foreach ($short as $key => $pieces) :
if (!($key % 2) && $key < (count($short)-1)) :
$tmpex[] = implode(array($short[$key], $short[$key+1]));
endif;
endforeach;
if (isset($tmpex)) $output = trim(implode('
', $tmpex));
endif;
if (!empty($readmore)) $output.=' '.$rmtext.'';
$output = ($filter === true) ? apply_filters('the_excerpt', $output) : $output;
return $output;
}
} // A5_Excerpt
?>