I dont see what's the problem with:
$str1 = "test";
$str2 = "test";
if ($str1 == $str2) {
echo 'match';
} else {
echo 'different';
}
Basically, you need to give an example (that is as small and as simple as possible) that actually doesnt work.
Your example obviously doesnt work - $home_team and $selected_team are not declared.