I need to strip a URL using PHP to add a class to a link if it matches.
The URL would look like this:
http://domain.com/tag/tagname/
Ho
For your URL
The PHP function to get "tagname" is called basename():
"tagname"
echo basename('http://domain.com/tag/tagname/'); # tagname