As shown in the picture:
After the code in the picture is executed, the type of $result must be false. Because $a is not greater than $b.
The current requirement is that the value of $string is an expression filled in by the user (the format is irregular), and then I will judge whether the result of the expression he filled in is true. If the result is false, let the program tell the user the incorrect form output alone.
Just like the picture above, I want the program to output, because $a>$b is not true, so the result is false. How to achieve
灭绝师太2020-11-09 10:12:37
Backend return json_encode(['status'=>0,'msg'=>'$a>$b is not established, so the result is false']); The front-end js receives and then alert() is given to the user. Enough.