
07.06.2009, 15:44
|
|
Reservists Of Antichat - Level 6
Регистрация: 25.04.2008
Сообщений: 827
С нами:
9497186
Репутация:
1304
|
|
spamoney
PHP код:
$str1="show.php?tut={rus}&trem={eng}&pabam={num}";
$str2="{rus}/page-{num}/{eng}.html";
function zamena($str1,$str2)
{
$array = array('{rus}','{num}','{eng}');
foreach ($array as $one) $outarr[$one]=strpos($str1,$one);
asort($outarr, SORT_NUMERIC);
$outarr=array_keys($outarr);
foreach ($outarr as $i => $one) $str2 = str_replace($one,$i+1, $str2);
return $str2;
}
echo zamena($str1,$str2);
|
|
|