Reputation: 5183
Here again with new problem
$a='
1
2
3
';
in textarea it displayed without the first new line.
<?php echo'<textarea>',$a,'</textarea>'; />
like this
----------------
1
2
3
----------------
but it should be like this?
----------------
1
2
3
----------------
PS sorry for my English =)
Upvotes: 3
Views: 248
Reputation: 854
You need to introduce a character the browser will render between lines, as an HTML parser will ignore normal whitespace characters. Namely: put a break (literally "<br>") tag between things you want on separate lines.
Upvotes: 0
Reputation: 70
Use the HTML decimal or hexadecimal code for carriage return instead of a space.
<textarea>

1
2
3
</textarea>
Upvotes: 3