JS,There's no difference between single and double quotes, just look at your own habits.However, if you use double quotes in double quotation marks, you need to use backslashes to suppress the parsing of double quotes: alert("ABC\"def\ "ghi"); But
S, single quotes in HTML, double quotes and their escape use (GO) collectionIn the JS in the relevant characters to make judgments or values, or spell HTML to assign value in many cases will use these, but also I have just encountered the problem,
PHP single double quote difference, PHP double quote Difference
in PHP, the definition of a string can use single quotation marks ' ' in English , you can also use double quotes " " in English .
However, you must use the same single or double
1. Both single and double quote usages are the same, but if you have the same characters in a string, you use \ to escapeExample:1) print ' Hello '2) print "Hello"1 and 2, and the result is hello.3) print ' hell\ ' o '4) print "Hell ' o"3 and 4, the
One, single quotes and double quotes escape in the PHP data stored procedures used more, that is, to store data in the database when you need to pay attention to escape single, double quotes;
Let's say a few PHP functions:
1, addslashes-use
character preceded by backslash, including single quote, double quote, backslash PHP Tutorial code
function D_addslashes ($string, $force = 0) {
if (! $globals [' MAGIC_QUOTES_GPC '] | | $force) {
if (Is_array ($string)) {
foreach ($string as
In PHP, single and double quotes are not interoperable, the specific difference is as follows:
The fields inside the double quotes are interpreted by the compiler and then exported as HTML code.
' Single quotes inside without explanation, direct
The difference between single quotation marks and double quotes in PHP
In a programming language, both single and double quotes are important, as is the case in the PHP language. Compared to ASP, PHP quotation marks better use, in ASP, to put the
PHP Jsonp single quote escape, JSONP quote escape
PHP JSONP output is generally in the following format:
Callbackname (' JSON string ');
If the middle JSON string contains single quotes, this output is problematic and the caller is generally unable
1. Defining Strings
In PHP, the definition of a string can use either single quotation marks or double quotes. However, you must use the same single or double quotation marks to define strings, such as: ' Hello ' and ' hello ' are illegal
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.