laravel {{ 变量名 }} {!! 变量名 !!}

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yueruitao/article/details/82109109
  • {{ 变量名 }} :转义输出
  • {!! 变量名 !!} :原生输出,比如图片,链接,js代码等
  • 这两者有什么区别呢?比如对于 $name = '<script>alert(hello)</script>'; ,使用 {{ $name }} 将输出 <script>alert(hello)</script>,而使用 {!! $name !!} 则会弹出 alert 窗口。
  • 蚂蚁小草

猜你喜欢

转载自blog.csdn.net/yueruitao/article/details/82109109