我想判断 $_SERVER['REQUEST_URI']
比如它是 /price/xilie-123-abc.html
我用以下方法就是批配不上,帮看看是什么原因,谢谢!
以下是我的代码:
$abc=$_SERVER['REQUEST_URI'];
if(preg_match("/\/price\/xilie-\d-[abc|nba|cba]\.html/",$abc)){
echo "是";
}else{
echo "不是";
}
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
\d只能配对一个数字,不能配对多个数字,需要配对多个数字,需要使用\d+我觉得你可以先看看这个...