Purpose:In order to prevent SQL injection, tid and goods_id are both positive integer types, and people should not append statements such as ?tid=1 or 1 afterwards.
principle:No matter how sinister your parameters are, the +0 will honestly become numerical types.
For example, the value becomes 1 after '?tid=1 or 1' , $_GET['tid']+0;
A student asked, why don’t you use (int) force conversion or intval to convert.
1: Which method is used, the purpose is the same
2: To use +0, you only need to type 2 characters, use (int) to type 5, and intval() to type 8.
3: For +0, I don’t need to care whether $tid is an integer or a floating point type, or a long integer larger than 2^32 (such as getting bigint in mysql), +0 can adapt.
If you use a strong rotation, there will be overflow. Of course, you can say that if I use float to rotate, isn't that the difference between scores?