Why doesn't '==' work in PHP?
4 answers
Instead of repeating them, use var_dump()
to see exactly what is stored in these variables:
var_dump($getuser); echo "<br />";
var_dump($userurl); echo "<br />";
+4
a source to share
When i try
$getuser = 2;
$userurl = 2;
echo $getuser. "<br />";
echo $userurl. "<br />";
if ($getuser == $userurl) {
echo "true <br />";
}
Results:
2
2
true
Works for me. In XAMPP (Windows) and Linux (Apache). So the problem is probably somewhere in the configuration or something ...
+1
a source to share