Jump to content

[SOLVED] How to add paragraphs when display data in PHP?


ifusion

Recommended Posts

Hi there,

 

I'm wanting to post information from a textarea, then if the user has added a break or paragraph in that info then have it display the same as how they wrote it in the form. For example:

 

If the user writes this.

 

Hi there,

 

This is a test and im wanting to see what happens.

 

Thanks for looking!

 

Theres 2 spaces. If i echo that out with the code below it would echo out as one whole paragraph.

 

Heres my code:

 

<html>

<head></head>

<body>
	<form action="send.php" method="post">
	<textarea name="info" rows="8" cols="40"></textarea><br>
	</form>
</body>

</html>

 

PHP:

<?php

$info = $_POST['info'];
echo $info;

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.