'/.+(\\?'.$var.')=(.*)$/AU', /* at front and only var */
'/.+(\\&'.$var.')=(.*)$/AU' /* at the end */
);
- $url = preg_replace('/&/','&',$url);
+ $url = str_replace('&','&',$url);
// FIXME: why switch is used instead of if () or one preg_match()
switch (true) {
if ($k) {
if ($val) {
$rpl = "$k=$val";
- if ($link) {
- $rpl = preg_replace('/&/','&',$rpl);
- }
} else {
$rpl = '';
}
$pat = "/$k=$v/";
$url = preg_replace($pat,$rpl,$url);
}
- $url = preg_replace('/&/','&',$url);
+ if ($link) {
+ $url = str_replace('&','&',$url);
+ }
return $url;
}