LoginSignup
0
0

More than 1 year has passed since last update.

Laravel 8でテキストを改行させ、埋め込まれたJSを実行させない方法。

Last updated at Posted at 2021-09-12
<p>{!!  nl2br(e($post->body)) !!}</p>

e()で文字実態参照に変換。
nl2br()で改行コードを改行タグに変換。
{!! !!}でbrタグで改行させるようにする。(文字実体参照への変換を無効にする)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0