Associate
- Joined
- 18 Oct 2002
- Posts
- 747
I have a dynamic url that is called $name
The url is in the form of
But it also changes its form depending on were it is called from and can be something like the one below
Where the “&page=2” is added. The “2” can also be any number from 2 upwards.
Is there some PHP code that I can use to look at the $name variable and strip everything off the end of the url from and including the “&” if it is present, to leave me with a url that always takes the form of the first example?
The url is in the form of
Code:
http://www.mysite.co.uk/gallery/index.php?album=Seals
But it also changes its form depending on were it is called from and can be something like the one below
Code:
http://www.mysite.co.uk/images/index.php?album=Seals&page=2
Where the “&page=2” is added. The “2” can also be any number from 2 upwards.
Is there some PHP code that I can use to look at the $name variable and strip everything off the end of the url from and including the “&” if it is present, to leave me with a url that always takes the form of the first example?