Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about nl2br

Read more about nl2br

python (65.2k questions)

javascript (44.3k questions)

reactjs (22.7k questions)

java (20.8k questions)

c# (17.4k questions)

html (16.3k questions)

r (13.7k questions)

android (13k questions)

Questions - nl2br

PHP nl2br for text content but make it exclude on javascript content

I need to use nl2br function on page content coming from DB. But <br /> tag added to into javascript content too. <script type="text/javascript"><br /> let test = "tes...
test-img

Serkan

javascript

php

nl2br

Votes: 0

Answers: 1

Latest Answer

Assuming your regex suites your need, you can use preg_replace_callback to achieve what you want. //content coming from db $content = preg_replace_callback("/<script\b[^>]*>([\s\S]*?)<...
test-img

keyhan

How to get line-breaks displayed while input in a textarea?

After several hours of research, I am still stucked and unable to solve my problem which is this one : get displayed the break line (enter button) input by the user in a textarea. Indeed, I am trying ...
test-img

vip4rk

php

textarea

line-breaks

article

nl2br

Votes: 0

Answers: 0

Why do I get \r\n stored in the database and how to display it back as a new line?

I am not sure what the safest way is to get the value of a textarea into a MySQL table, hopefully someone can get me on the right track. Form: <form class="form-horizontal" id="form_...
test-img

Arie

ajax

mysqli

textarea

nl2br

Votes: 0

Answers: 0

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved