A common problem for beginners is that database errors are prompted when special characters are submitted. Today we will introduce a set_magic_quotes_runtime function to help you filter the content.
PHP function set_magic_quotes_runtime (0); you can modify magic_quotes_runtime Boolean settings in PHP. ini. When your data contains some
\
"
'
This character is useful when it needs to be written to the database and is not filtered out. It will add \
China \ "Haha"
China \ \ "Haha \" set_magic_quotes_runtime is the variable used to set the PHP environment configuration magic_quotes_runtime
Value.
0-Close 1-open
PHPProgramIn the detection status, use get_magic_quotes_runtime. If the returned value is 0, this function is disabled. If the returned value is 1, this function is enabled. If
When magic_quotes_runtime is enabled, all externally introduced database data or files are automatically converted to materials containing backslash overflow characters.
For example, you can use PHP to import a database.