To solve your question without having to make an arrangement, go through it in a cycle and go asking if that substring exists in the reference url, I found an unorthodox solution. First you store in an array the addresses you want to check that are in your $ mayreferr , then I made a function that what you recive are 2 parameters: the first is the address where you are going to search for the urls that exist you already know in advance and the second parameter are these urls. So following the idea in reality in the body of this function, what I will do is create a variable where I replace the original URL string with any occurrence of the addresses of the second parameter by an empty space and then compare the length of parameter 1 with the new string generated from this substitution, if both have the same length is that no change was made and therefore there is no occurrence of these urls in that parameter, otherwise if it existed and return true.
Here is the code:
$sitios = ['misitio.com','mysite.com'];
echo encontrar_url('http://www.mysite.com', $sitios) ? "Se encontro" : "No se encontro";
function encontrar_url($buscar, $urls){
$str = str_replace($urls, [''], strtolower($buscar));
$result = false;
return !(strlen($str) === strlen($buscar));
}
To land this example in your case it would be this way
$mayreferr = @$_SERVER['HTTP_REFERER'];
$sitios = ['misitio1.com', 'misitio2.com', 'misitio3.com'];
if(encontrar_url($mayreferr, $sitios)){
echo "Se encontro";
} else {
echo "No se encontro";
}
function encontrar_url($buscar, $urls){
$str = str_replace($urls, [''], strtolower($buscar));
return !(strlen($str) === strlen($buscar));
}
Clarify that if your sites are going to be like the ones you left as an example misitio1.com, misitio2.com, with a regular expression you solve your problem, so this solution is rather directed to different urls, not those that contain a form default I hope it serves you.
EDIT I added strtolower to the variable $ search to add that it is not case sensitive, that is to say case sensitive.