PHP - Type Handling
What is wrong with this PHP code?
$num = '10';
if ($num = 10) {
echo 'Matched';
}
$num = '10';
if ($num = 10) {
echo 'Matched';
}
if ($num = 10) assigns 10 to $num instead of comparing it.== or ===, not = which is assignment.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions