I have the following JS:
if(window.location.href.indexOf("search.php") != -1 || window.location.href.indexOf("list.php") != -1 || window.location.href.indexOf("view.php") != -1 || window.location.href.indexOf("contact.php") != -1) { But want to convert it to PHP. What is the equivalent of indexOf in PHP or the best way to do this in PHP.
I don't understand the strpos examples people are linking to below. Perhaps an example more in line with what I have done in JS?
if( /(search|list|view|contact)\.php/.test(window.location.href))though