nethken nethken - 3 months ago 6x
HTML Question

Display the fetch data with spaces or break - PHP

I want to display the data with some spaces or break lines. Can someone help me about this? Im using

for the news content in adding and editing. And the data type for my news content is

i the content want to display like this.
enter image description here

here is my work. As you can see there is no break there
enter image description here

here is the code for fetching the data.

$newsid = $_GET['newsid'];

$sql ="SELECT * FROM news WHERE news_id = '$newsid'";
$result = mysqli_query($con, $sql);

while($row = mysqli_fetch_array($result)){
$title = $row['news_title'];
$date = $row['news_date'];
$content = $row['news_content'];
$newsimage = $row['news_image'];

<img src="<?php echo $newsimage; ?>" alt="court" style="width:100%; height:430px; ">
<div class="content">
<div class="container">
<div class="row">
<div class="fix midbar">
<div class="viewnews">
<h3><?php echo $title; ?> </h3>
<p>Date posted: <?php echo $date; ?></p>
<p><?php echo $content; ?></p>



You can use nl2br

nl2br — Inserts HTML line breaks before all newlines in a string


string nl2br ( string $string [, bool $is_xhtml = true ] )

Returns string with <br /> or <br> inserted before all newlines (\r\n, \n\r, \n and \r).