Function set_magic_quotes_runtime () of PHP

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.