我想寫代碼,看看網站的網址是否有任何「=」或「?」在urlPHP的正則表達式來查找?或=不工作
我在$網站(例如www.smith.com?page=1)的URL應該被找到,但它不是在下面的代碼
$cleanurl_text = "You appear to have a clean url structure.";
$regex = '/=/i';
if (preg_match($regex, $website))
{
$cleanurl_text = "You do not appear to have a clean url structure.";
}
$regex = '/?/i';
if (preg_match($regex, $website))
{
$cleanurl_text = "You do not appear to have a clean url structure.";
}
對於這個downvoter,請解釋爲什麼你認爲這應該是一個downvote。 –