Get_magic_quotes_gpc
Script ec (2); script
() Function
In PHP, the () function is a built-in function. The function is used to obtain the value of the magic_quotes_gpc option in the php. ini setting.
Then let's talk about the magic_quotes_gpc options:
If magic_quotes_gpc = On, the PHP parser automatically adds the Escape Character "" to the data from post, get, and cookie to ensure that the data will not cause the program, in particular, database statements may cause fatal errors due to pollution caused by special characters.
In the case of magic_quotes_gpc = On, if the input data has
Single quotation marks ('), double quotation marks ("), backslash (), and NUL (NULL character) are all added with a backslash. These escaping are required. If this option is off, we must call the addslashes function to add escaping to the string.
It is precisely because this option must be On, but there is a conflict between the user's configuration. After this option is deleted in PHP6, all programming needs to be done under magic_quotes_gpc = Off. In such an environment, if user data is not escaped, the consequences are not just program errors. Similarly, it may cause the risk of database injection attacks. Therefore, from now On, you should not rely On this setting to be On any more, so that one day your server will need to be updated to PHP6 and your program will not work properly.
When magic_quotes_gpc = On, function () returns 1
When magic_quotes_gpc = Off, the function () returns 0.
Therefore, we can see that this () function is used to obtain the value of the environment variable magic_quotes_gpc. Since the magic_quotes_gpc option is deleted in PHP6, this function will no longer exist in PHP6.