According to your new specified requirement, if a string starts with 'admin' can be checked like this:
$your_string = 'admin.test';
if(strcmp(substr($your_string, 0, 5), "admin") == 0)
{
echo 'begins with admin';
} else {
echo 'does not begin with admin';
}
EDIT:
If you have an array of strings, example $array = array("admin.test", "test", "adminHello", "hello")
, you could make a function that checks if the array contains at least one string that begins with admin:
function checkArrayStartsWithAdmin($array)
{
$result = false;
foreach($array as $key => $value)
{
if(strcmp(substr($value, 0, 5), "admin") == 0)
{
$result = true;
break;
}
}
return $result;
}