Line break issue

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
udayasl
New php-forum User
New php-forum User
Posts: 1
Joined: Fri Nov 27, 2020 9:07 pm

Fri Jun 18, 2021 8:56 pm

In my website users can be registered through this page:

Code: Select all

https://www.onlanka.com/friends/add.php?l=default
After someone entered their details into the "Description" area, I can see line breaks were stored as

Code: Select all

<br>
inside the MySQL table.

Then it's output shows

Code: Select all

<br>
in the following page (See About row):

Code: Select all

https://www.onlanka.com/friends/view.php?l=default&id=35201
But I need only the line break (break the line / new line) instead of showing

Code: Select all

<br>
How can I resolve this issue?
User avatar
hyper
php-forum GURU
php-forum GURU
Posts: 1222
Joined: Mon Feb 22, 2016 5:52 pm

Sun Jun 20, 2021 4:57 pm

Find out what is converting the line break codes into a HTML line break and work around it, try looking for 'nl2br()'.

It might be a case of 'search and replace "&lt;br&gt;" with "PHP_EOL"'.

If you're using a framework, it may be worth checking if it does this for you and find a workaround.
Post Reply