<?php
$url = "http://localhost/news&lang=en&lang=sk&lang=sk&lang=sk&lang=en";
$langs = array ('sk', 'en');
foreach ($langs as $lang) {
$search = '&lang='.$lang;
$new = str_replace($search, "", $url);
}
echo $new; // output: http://localhost/news
?>
问:如何从字符串中删除所有参数(&lang=en,&lang=sk)?
先感谢您