The usage of the PHP configuration function ini_get () is described in detail. Output: display_errors1register_globals0post_max_size8Mpost_max_size + 19PHP configuration function ini_get () is mainly used to obtain the configuration file, which can facilitate many operations. RatioOutput:
- Display_errors = 1
- Register_globals = 0
- Post_max_size = 8 M
- Post_max_size + 1 = 9
The PHP configuration function ini_get () is mainly used to obtain the configuration file, which facilitates many operations. For example, if you want to filter strings, but do not know whether magic_quotes_gpc is enabled, you can write a function like this:
- /* String filter function */
- Function stringFilter ($ str)
- {
- If (ini_get ('Magic _ quotes_gpc )')
- {
- Return $ str;
- }
- Else {
- Return addslashes ($ str );
- }
- }
Of course, if you cannot know whether your global variables are enabled, you can also customize the following functions:
- /* Variable detection function */
- Function getGetVar ($ var)
- {
- If (ini_set ('register _ gobals '))
- {
- Return $ var;
- }
- Else {
- Return $ _ GET ['var'];
- }
- }
Of course, you can use the PHP configuration function ini_get () for many purposes.
Export display_errors = 1 register_globals = 0 post_max_size = 8 M post_max_size + 1 = 9 PHP configuration function ini_get () is mainly used to obtain the configuration file, which can facilitate many operations. Than...