Re: [Phplib-users] clean the url from session
Brought to you by:
nhruby,
richardarcher
|
From: Sascha W. <sas...@gm...> - 2002-06-01 13:58:31
|
At 04:57 01.06.2002 +0200, you wrote:
>I am not keen with grep. I need a slightly different version of the
>existing: if e.g. your session is 'Example_Session=', but I don't know
>its value, I want to clean it whatever it is until the next name=value
>pair in the URL.
Perhaps this may help you:
//$filters must be an Array
function filter_parameters($url, $filters){
foreach ($filters as $filter) {
$url = preg_replace('#\?' .
$filter .
"=.{32}$|&" .
$filter .
"=.{32}$|" .
$filter .
'=.{32}&#msiU',
'',
$url
);
}
return $url;
}
In the result all name-value-pairs with the names specified in the array
$filters are removed.
Copyright-Note: I've taken this alghorithm from phpOpenTracker by Sebastian
Bergmann. Thanks by the way!
Sascha.
|