How to check URL if something has that word

Learn PHP

There is a cases that we need to check our URL if there is a word we need on it.

To search a URL in a specific word, Use this code.

First the $_SERVER[‘REQUEST_URI’] will return the full path of the URL including the query string, in my case I put it on a variable called $url then I use strpos function to find the word “findme” in the full path of the url.