Ask Your Question
4

What is the method to show a line break <br> between <div> elements in Laravel?

asked 2022-06-13 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-09-11 07:00:00 +0000

ladyg gravatar image

In Laravel, you can use the double curly brace syntax with the nl2br function to show a line break between div elements. For example:

<div>
    {{ nl2br($text) }}
</div>

<div>
    {{ nl2br($moreText) }}
</div>

This will output the $text and $moreText variables with a line break between the two div elements. The nl2br function converts newline characters to HTML line breaks.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-13 11:00:00 +0000

Seen: 8 times

Last updated: Sep 11 '21