I just want to ask, can I write php code like this? True and flase are not used.
Liang Jingru
$ Abc = 4/2;
If ($ abc = 2 ){
Echo $ abc = true;
Else {
Echo $ abc = false ;;
?>
Reply to discussion (solution)
Liang Jingru
Why not enclose the brackets? The java language must be enclosed in parentheses in the if clause.
Liang Jingru
The landlord, the single equal sign is a value, not a judgment.
You assign $ abc to 2 in if, non-zero, true, and else meaningless.
The values after echo should also be converted to the double equal sign to determine whether the values are equal.
In this case, if the value of $ abc is 2 $ abc = true, the result is 1.
You saved the file in. php format!
Liang Jingru
$ Abc = 4/2;
If ($ abc = 2)
Echo $ abc = true;
Else
Echo $ abc = false ;;
?>
If ($ abc = 2)
"=" Indicates that the value assignment is not a comparison.
= Value = Compare content = compare address and content
If ($ abc = 2) {// $ abc = 2