Difference between single quotes and double quotes textarea has two rows of data. namesourceaaaaaaaaaaabbbbbbbbbbb I use explode (& quot; rn & quot;, $ _ POST [source]) two elements use explode (rn, $ _ POST [source]) and only one element. solution ------------------ difference between single quotation marks and double quotation marks
Textarea has two rows of data, name = source
Aaaaaaaaaaa
Bbbbbbbbbbbbb
I use explode ("\ r \ n", $ _ POST ['source']) to produce two elements.
Explode ('\ r \ n', $ _ POST ['source']) has only one element.
------ Solution --------------------
As for your location, the owner can tell you that it is in single quotes.
For example, $ src = explode (',', $ src );
------ Solution --------------------
$ Str = "hello ";
Echo '$ str'; // The result cannot be parsed: $ str
Echo "$ str"; // The parsed result is hello.
This is the difference between single quotes and double quotes.
I have not been dealing with php for a long time.
------ Solution --------------------
Php parses the variables in double quotes. for example, "$ I" is executed to display the value of the I variable.
However, if you put the '$ I' variable in single quotes, Php will directly output $ I, which is also displayed on the page without displaying the actual value of variable I.
------ Solution --------------------
Double quotation marks expand the variables, for example, $ varname = hello, "123 {$ varname} 123" is eventually "123hello123". double quotation marks escape the escape characters, for example, "\ n \ r" means a carriage return line break.
Variables are not expanded in single quotes. escape characters like escape are not allowed. except for single quotes, '\ n \ r' is the four characters.
------ Solution --------------------
Discussion
Php parses the variables in double quotes. for example, "$ I" is executed to display the value of the I variable.
However, if you put the '$ I' variable in single quotes, Php will directly output $ I, which is also displayed on the page without displaying the actual value of variable I.
------ Solution --------------------
Discussion
Textarea has two rows of data, name = source
Aaaaaaaaaaa
Bbbbbbbbbbbbb
I use explode ("\ r \ n", $ _ POST ['source']) to produce two elements.
Explode ('\ r \ n', $ _ POST ['source']) has only one element.
------ Solution --------------------
In the single quotation mark string, even the backslash also loses its extended meaning (except for inserting the backslash \ and the insert ticket
Quotation marks \'). Therefore, when you want to replace the variable in the string and include escape sequences such as \ n (linefeed), you should use double quotes
.