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
Many thanks to all, this code works for me:
$ptn = "/\//"; $str = "http://domain.com/tag/tagname/"; $result = preg_split($ptn, $str); $tagname = $result[count($result)-2]; echo($tagname);