транслит РУС- АНГ
<?php
function encodestring($st)
{
$st=strtr($st,"абвгдеёзийклмнопрстуфхъыэ",
"abvgdeeziyklmnoprstufh'iei");
$st=strtr($st,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ",
"ABVGDEEZIYKLMNOPRSTUFH'IEI");
$st=strtr($st,
array(
"ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
"щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
"Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
"Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
"ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
)
);
return $st;
}
?>
<?php
preg_match("#<a.*?href=\"(.+?)\".*?>.+</a>#is",$page[$p],$out);
unset($out[0]);
$href = encodestring($out[1]);
$newname = preg_replace("#<a.*?href=\"(.+?)\".*?>(.+?)</a>#is","<a href=\"".$href."\">$2</a>",$page[$p]);
?>