php str_replace () function of the specific situation
str_replace ($ search, $ replace, $ subject)
E.g
1
str_replace ("n", "
", '465s4d6f5s4ad1as65d4fa6sn54df65sdafgsdfn65g4sd65g4hdf6n54ghd6fbghdfgh'); // Note the quotes
Output: 465s4d6f5s4ad1as65d4fa6sn54df65sdafgsdfn65g4sd65g4hdf6n54ghd6fbghdfgh
2
str_replace ("n", "
"," 465s4d6f5s4ad1as65d4fa6sn54df65sdafgsdfn65g4sd65g4hdf6n54ghd6fbghdfgh "); // Note the quotes
Output:
465s4d6f5s4ad1as65d4fa6s
54df65sdafgsdf
65g4sd65g4hdf6
54ghd6fbghdfgh
3
str_replace ('n', '
', "465s4d6f5s4ad1as65d4fa6sn54df65sdafgsdfn65g4sd65g4hdf6n54ghd6fbghdfgh"); // Note the quotes
Output:
465s4d6f5s4ad1as65d4fa6s 54df65sdafgsdf 65g4sd65g4hdf6 54ghd6fbghdfgh
Note: Single quotes simply represent pure strings
The double quotes are to be compiled by the compiler
In other words, 'n' and 'n' are different, the former refers to the string n, which is the compiler n, is the meaning of the transfer character
So when only the $ search and $ subject variables are single or double quotes at the same time will have an effect.
From the text box or take out the value is transferred, that is to say there is a transfer of n, so use 'n' is useless, be sure to use "n"