i am inserting two pragraphs from an input text field and saving it in a $post variable i.e.

Almost all search engines give results in the form of links to web pages which they have indexed. These results depend on the keywords written on the search bar .
For example if you are searching for who made the telephone, chances are we come across a Wikipedia for the telephone and then get the information, after click on the links.

and when i print this on browser using

echo $post;

command then it print like this

Almost all search engines give results in the form of links to web pages which they have indexed. These results depend on the keywords written on the search bar . \r\nFor example if you are searching for who made the telephone, chances are we come across a Wikipedia for the telephone and then get the information, after click on the links.

and when i print this using

<p><?php echo $post ?></p>

command then it print like this (joining both pragraphs)

Almost all search engines give results in the form of links to web pages which they have indexed. These results depend on the keywords written on the search bar.For example if you are searching for who made the telephone, chances are we come across a Wikipedia for the telephone and then get the information, after click on the links.

I want to get same paragraphs without being combined ,how i can do that ??

Member Avatar for diafol

do this :

echo nl2br($post);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.