質問

I would like to know how to do an 'if requested URL like' statement. For example, I currently have the following code, but I want to the base, icon and logo applied on all locations after route=checkout/

What is the wildcard value? Am I on the right lines?

<?php
if($_SERVER["REQUEST_URI"]=="/index.php?route=checkout/checkout")
$base='https://domain.co.uk/>';
$icon='/image/data/favicon.png';
$logo='/image/data/logo.png';
?>
役に立ちましたか?

解決

Strpos is perhaps what you want?

if (strpos($_SERVER['REQUEST_URI'], '/index.php?route=checkout') !== false) {
// Do your stuff here.
}
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top