-1

I want to show the data which is stored in sql column like a package details of a tour. when i am calling that column it's displaying details but it's not showing in clean and neat way. It's displaying like a only a single paragraph. So i added <br> tag where i need a newline. But it's showing me that <br> tag in the website not a new line that's fraustating. How should i give the strong tag and br tag to that data.

ex: <b> Day1 :</b> <br>To park vist and bar<br> <strong> Day 2: </strong> <br>

Above mentioned is the data saved in column.

Am Expecting that the line breaker should work and has to display one by one with strong tag impact.

1
  • 2
    Probably your site is html-encoding content before displaying it, to prevent XSS attacks. So you need to decide if you can make an exception for this field, if it is safe enough to do so. You can potentially still ensure it strips out certain less desirable html tags (such as script, object etc)
    – ADyson
    Commented Aug 7, 2023 at 8:26

1 Answer 1

-1

if you only want break line then use textarea and simply add data with enter and after getting the data from database perform the following operation.

$mydata=nl2br($datafromdatabase);

then just print it. It will add

<br /> 

after every line. But if you want to design the font size and font style or something else then use any editor for getting all options. you can use popular editor called CKEditor

Not the answer you're looking for? Browse other questions tagged or ask your own question.