I'm trying to compare 2 values, one coming from post data and the other one coming from an array, the weird thing is, when I compare them, all of the records show that they are not equal but some of the values have equal values:
What I actually need to do is to unset those values that are not equal in the post data sent.
$a = $_POST['time']; (Value is 01:03)
$testarray = array("12:30","01:03","03:30");
for($x = 0; $x < count($testarray);$x++){
if($a === $testarray[$x]){
echo "ok";
}
else
{
echo "not";
}
}
All of the my results are showing not, even though there is a similar value on one of the contents in the array.
What seems to be the problem here? I've check the values and the data types are both string.