I am trying to write code to see if a website url has any “=” or “?” in the url
I have the url in $website (example http://www.smith.com?page=1) should be found but it is not in the following code
$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.";
}
You shouldn’t use regex for this but more http://php.net/manual/en/function.strstr.php
anyway if you still want your regex you should do something like this