In the process of writing code at ordinary times, it is often used to judge the equality of variables and constants, such as if($a==1){…..} or if(1==$a), in terms of execution efficiency, 1 ==$a is more efficient than $a==1.
Another advantage of this writing,When using the == operator to compare variables and constants of a certain type, it is better to write the constant to the left of the "==" operator, such as 'A'==word, so that if you accidentally put "==" Written as "=", it becomes 'A'=word, then the compiler will give an error message. And if it is written as word='A', this is a normal assignment statement. The assignment is successful and returns true. Of course, this should not be what you originally meant, so a logical error will occur.