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

Popular posts from this blog

Python __call__ special method practical example -

How can I edit my VIM config so that Vim treats ".ejs" files the same as it currently treats my html files? -