A
Anonymous
Guest
I'm trying to show you why it's wrong so that you can avoid it in the future; run the script, see what the difference is and learn why :?
$a = 6;
# Assign the value 6 to the variable $a
if ($a == 6)...
# Test $a to see if it evaluates to 6
if ($a = $b) {
# assign $a with the value of $b and return true
# this will always execute
} else {
# this will never execute
}
hyper said:Code:if ($a = $b) { # assign $a with the value of $b and return true # this will always execute } else { # this will never execute }
# assign $a with the value of $b.
if ($a = $b) { # evaluate $b as boolean
# this will execute if $b evaluates to true
} else {
# this will execute if $b evaluates to false
}
if ($b){...