I need to replace not just the ASC or DESC but the value it's sorting by. i.e. in a string like this:
http://www.mysite.com/page1.php?valu...sort=ORDER+BY+uservalue1+DESC
I've not had that much experience with regular expresions and haven't had any luck with figuring out a way to replace just the bold part in the string above (after ORDER+BY.) Bear in mind, uservalue1 and DESC after ORDER+BY may be something else, like uservalue3 ASC or uservalue 5 DESC.
I've found some great resources including the comments on the php.net function page and this board, but am still stumped.
Can anyone show me what would work and more importantly how the expression breaks down to find the string? Or, is there another way to do this that I've overlooked? Thanks!