Summary of PHP quotation marks and backslash

Source: Internet
Author: User

Source: bo-blog

1. magic_quotes_gpc = on:
=> \
=>
"=>"

2. When "inserting a database, the characters remain and are" and ". Therefore, you do not need to read stripslashes again.
Exception: magic_quotes_runtime = on.

3. If the/e modifier is used in the pattern of preg_replace, the situation in which replacement is passed to the callback function is:
=>
=>
"=>"

4. Read from the database. When magic_quotes_runtime = off, it seems => null?

Conclusion: The problem of quotation marks and backslash is complex, and varies with different server settings.
Now my solution is
==&# 92;
Htmlspecialchars is used for quotation marks, and quote_style is set to ENT_QUOTES.

We hope that the issue of code pasting in SP1 can be solved.
Test:
 

<? Php
Error_reporting (E_ALL );

/* Add redirection to get stderr output with a standard error. */
$ Handle = popen (/path/to/spooge 2> & 1, r );
Echo "$ handle;". gettype ($ handle )."";
$ Read = fread ($ handle, 2096 );
Echo $ read;
Pclose ($ handle );
?>

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.