i have an javascript which i want to show only if URL do NOT contains certain phrasses. Like include javascript in webpage only if URL is free from words: cars, motorcycles
So far i found this code, but it is only for one word:
Do you know how to use loops? Have all of your terms in an array, and do a foreach loop through the array. On each item, say if (the array item is present in url) then ( make a counter variable like $failed =1 and break)
Then you can use a simple conditional
if (failed) then …
else…
Edit: The above assumes you want a solution that will let you have several terms. If you only have a few, you could easily do an if / else if / else exactly as you have it - or a switch statement.