Home » PHP developer » Checking if a URL has certain string within it using PHP

Checking if a URL has certain string within it using PHP

This PHP example checks the url has ‘fabbro.uk’ in it.

Alternatively you can shorten this to

if (strpos($_SERVER[‘REQUEST_URI’], “car”) !== false){
echo ‘string found’;
}

Support