Forum Moderators: coopster
1) http://example.com/english/songs.php?cid=some
2) http://example.com/english/lyrics.php?cid=some
I need to take only word "songs" from first url and "lyrics" from second url as variable for another operation.Please tell how it can be done.
thanks.
[edited by: coopster at 11:49 am (utc) on Aug. 7, 2006]
[edit reason]
[1][edit reason] examplified url [/edit] [/edit][/1]
If you want to check the occurence of something in a string, you can use the strstr [uk.php.net] function.
if (strstr($url, 'songs'))
{
//do something
}
or use the referer:
if (strstr($_SERVER['HTTP_REFERER'], 'songs'))
{
//do something
}
Or are you not sure of the urls and need the value of the page without the .php?
dc