I'm currently using the following code to generate an active state on links:
<?php if ($_SERVER["REQUEST_URI"] == "/styles/bracelets.html/"):?>
You could use strpos() in this case:
if (strpos($_SERVER['REQUEST_URI'], '/styles/bracelets.html/') === 0):
This basically checks to make sure
/styles/bracelets.html/ is at the beginning of the request URI and will also pass if there is additional content trailing the
/ on the end.
strpos will return false if the need is not found in haystack, or 0 if it is found at the beginning of the haystack hence the need for
preg_match() would also work, but strpos does the trick in this case.