Jump to content

[SOLVED] strip out part of a string - should be easy enough


CaptainChainsaw

Recommended Posts

Hi all,

 

I need to strip out the "pagenumber" param from the following query string:

 

search.php?pagenumber=2&param0=a

 

I have a search script which is passing any seach params dynamically.  So both these query strings are searching for the letter 'a'.  The problem is that the pagenumber is passed around so it creates another param for it each time the "next page" link is clicked and it screws up the search.

 

search.php?pagenumber=2&param0=2&param1=a

 

Can anyone help with this one? What string functions would be best for this?

 

 

Thanks in advance.

 

CC :)

I tried that function using the following code:

 

public function removeParam($param){
parse_str($this->_querystring,$output);
unset($output[$param]);
return $output;
}

 

I didn't get the desired results as it still creates the 2nd query string.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.