I need to literally print \n inside of the the this.value.split
$rows .= "<textarea onkeyup='this.rows = (this.value.split(\"\n\").length||1);' ...
I cut the code short so its easier to read.
PHP parses it as a new line. How can I rewrite this string so that it will actually print \n ??
You need to backslash your backslash:
Alternatively, you could use single quotes to delimit your string, but this would mean you would have to escape all the literal single quotes.
Here is a demonstration: http://phpfiddle.org/main/code/s7g-ra9