$str = 'http://websitename/folder/index.php?pagez=load_searched&c=43&s=1&p=1'; how do I remove the '&p=1'; from the $str using regular expressions..
I guess the problem is that the '1' is not always a '1', otherwise you can use str_replace('&p=1', '', $str), right? Is it always a number? If so: $pattern = '/&p=\d+/'; $new_str = preg_replace($pattern, '', $str); PHP: Are you trying to do add a pagination feature?
no just practicing regular expressions anyway thanks I'm going to try it... just want to know some tricks using regular expressions.