我目前有这段代码:
$uri = $_SERVER["REQUEST_URI"];
if (preg_match("/smda/", $uri)) {
echo "whatever;
}
哪个捕获包含“smda”的任何网址。我想将其缩小到包含src = smda的任何URL。我认为代码是这样的吗?
$uri = $_SERVER["REQUEST_URI"];
if (preg_match("/src=smda/", $uri)) {
echo "whatever;
}
答案 0 :(得分:3)
正确且简单
if (isset($_GET['src']) && $_GET['src'] == 'smda')
{
echo "whatever";
}