Forum Moderators: coopster
/^.*?cats.*?snakes.*?$/i
/^.*?(cats)?(?(1)snakes|.?).*?(?(1)snakes|cats).*?$/i
Problem with that is if you have something like /cats-cats-snakes.php it will fail.<?php
if(preg_match('/.*?(cats|snakes).*?(cats|snakes).*?/i', $_SERVER['REQUEST_URI'], $out)) {
if(strtolower($out[1]) === strtolower($out[2])) {
// Error
} else {
// Success
}
}
?>
<?php
if(stripos($_SERVER['REQUEST_URI'], 'cats') !== false && stripos($_SERVER['REQUEST_URI'], 'snakes') !== false){
// TRUE
}
else {
//FALSE
}
?> i was thinking about using stripos, but didn't know the syntax