php - Capture newline from a textarea input -
i have textarea form in html. if user hits enter between 2 sentences data should carried on php.
currently if user enters:
apple google ms
and php code is:
$str = $_post["field"]; echo $str;
i
apple google ms
as output. want output this
apple google ms
what should do?
try nl2br()
instead:
echo nl2br($str);
Comments
Post a Comment