[Solved] Create variable from text string with new lines and quotes [duplicate]


How about this, which allows you to use unescaped quote marks in your text block:

$str = <<<DATA
saldflasdfl

asdklksadlasd "quoted string"


aslkdlsadfkl
DATA;

Note that it does need to be added with no whitespace indentation, since that would be taken to be part of the string.

However, do note that if your text block gets over a certain size, it is probably cleaner to put it in a text file and read it into a string.

3

solved Create variable from text string with new lines and quotes [duplicate]