Double quotes are not copied normally. How can I e

2019-02-20 17:32发布

问题:

When I copy the words with double quotes, .php pages show an error. Double quotes don't get copied normally. How can I solve it? Which codes can I edit? (My script is Wordpress.)

Example: $goster = getenv(“HTTP_USER_AGENT”);

Before HTTP and after AGENT double quotes in example above. It is a problem with my users. I think I must edit in blockquotes function in Wordpress. Any idea?

回答1:

Those are smart quotes (e2 80 9c), and aren't considered string delimiters by the PHP lexer, which it seems you already know.

Replace them with either the single quote ' or double quotes ". If you are copying those from a program which is replacing normal quotes with smart quotes, it's definitely not designed for code and you should stop using it for that purpose.



标签: php wordpress