In PHP, there is a difference between using single and double quotes. In this case, single quotes are for "common
strings ", and double quotes are used when you want to process the
string (concatenate, for example).
Is there any difference between using ' and ' for
use strict , for example?
alert('foo'); // Aspas simples alert("bar"); // Aspas duplas
There are no differences from a programming point of view, even using Strict Mode (
"use strict;" )
As pointed out by Carlos André, one approach is you can put single quotes inside the string or the opposite:
alert('Ola "Mundo"'); alert("Ola 'Mundo'");
However, if you are using JSON, strings in JSON use double quotes. Of course, several libraries also support single quotes, but using single quotes for strings does not conform to JSON standards .