How can I optimize following code.
<?php
define('MAGPIE_DIR', 'rss/');
require_once(MAGPIE_DIR.'rss_fetch.inc');
$url = "http://feeds.feedburner.com/abc";
if ( $url ) {
$rss = fetch_rss( $url );
$num_items = 20;
$items = array_slice($rss->items, 0, $num_items);
$arr = array("?", "abc.com Greetings", "abc Articles - Articles");
$bw = array("Web", ".htmlhttp://www.abc.com/Web");
$gms = array("abc.com Games", "htmlhttp://www.abc.com/Games/");
$musc = array("abc.com Music - RSS Feed", "htmlhttp://www.abc.com/Music");
$grt = array("http://www.abc.com/Greetings/");
$grt1 = array("create.php/");
$rcp = array("http://www.abc.com/Recipes/");
$rcp1 = array("recipe.php/");
foreach ($items as $item) {
$desc = $item['title'];
$link = $item['link'];
$desc = str_replace($arr,'', $desc);
$desc = str_replace($lf,'', $desc);
$desc = str_replace($bw,'', $desc);
$desc = str_replace($gms,' Game', $desc);
$desc = str_replace($musc,'', $desc);
$link = str_replace($arr,'/', $link);
$link = str_replace($gms,'html', $link);
$link = str_replace($musc,'html', $link);
$link = str_replace($grt,'', $link);
$link = str_replace($grt1,'http://www.abc.com/Greetings/create.php?', $link);
$link = str_replace($bw,'.html', $link);
$link = str_replace($rcp,'', $link);
$link = str_replace($rcp1,'http://www.abc.com/Recipes/recipe.php?', $link);
$link = str_replace(".htmlhttp://www.abc.com/Articles",'.html', $link);
if (preg_match("/\\bLafz\\b/i", "$link.")) {
$link = substr($link, 0, -(strlen("http://www.abc.com/Lafz")));
$desc = substr($desc, 0, -(strlen("Lafz")));
}
$desc = $desc. "...";
echo '<li><a href="'.$link.'">'. $desc. '</a></li>';
}
}
?>