PDA

View Full Version : PHP and htmlspecialchars


shoombool_tala
01-15-2006, 09:56 PM
Hi,
I have a textarea where users enter information about themselves. Then i used htmlspecialchars on it for obvious reason. The problem is tho when i use:

print $row['info'];

it displays the text all in one paragraph disregarding the spaces the user put.

For example the user has put:
"Hello my name is John,
I go to U of T and im graduating this year"

when i print it, it shows:
"Hello my name is John, I go to U of T and im grauating this year"

it fully disregards the new line the user has put. How can I fix this problem?
thanks

shoombool_tala
01-16-2006, 01:11 AM
nl2br solved the problem!