I need to check that 2 values from 2 different arrays are the same. I am currently getting one value from mysql and the other from facebook api.
$UserHomeTown[1]
is the users location and $city_Value[1]
is the friends location but when i try and check the value between these i always get false.
Tested the statement by echoing out to screen and this is what i get
if (Lancashire === United Kingdom) False
if (Lancashire === Lancashire) False
I have tried !=, !==, ===, == and still all i get is false,
Here is my code getting the information from facebook
$userFriend_profile = $facebook->api('/me/friends?fields=name,location');
$total = count($userFriend_profile['data']);
for ($i = 0; $i < $total;)
{
if(isset($userFriend_profile['data'][$i]['location']['name']))
{
$city_Value = explode(',',trim($userFriend_profile['data'][$i]['location']['name']));
if ($city_Value[0] != $UserHomeTown[0]) { // This on works
if (isset($city_Value[1])) {
echo "if ($UserHomeTown[1] === $city_Value[1])";
if ($UserHomeTown[1] === $city_Value[1]){
echo "<br> True<br><br>";
} else {
echo "<br> False<br><br>";
}
}
}
}
$i = $i + 1;
}