If you want to check if the current url contains a string use

window.location.href.indexOf

Here is a simple example which checks if the current url contain wthe world category.

$(document).ready(function () {
   if(window.location.href.indexOf("category") > -1) {
   alert("the url contains category");
  	} else {
  alert("the url doesn't contain category");}
});

It could be www.snippetbay.com/category/php