如图存入到数据库的格式是html标签,要求是前端解析成html
解决方案:
{!! $introduce !!} 相当于 <?php echo $introduce ; ?>
{{ $introduce }} 相当于 <?php echo htmlspecialchars($introduce ); ?>区别就是一个有转义,一个没有
{{ }} 支持转义 一段html代码只是被当成普通的字符串输出
{!! !!} 不支持转移 一段html代码可以被正常的解析
如图存入到数据库的格式是html标签,要求是前端解析成html
解决方案:
{!! $introduce !!} 相当于 <?php echo $introduce ; ?>
{{ $introduce }} 相当于 <?php echo htmlspecialchars($introduce ); ?>区别就是一个有转义,一个没有
{{ }} 支持转义 一段html代码只是被当成普通的字符串输出
{!! !!} 不支持转移 一段html代码可以被正常的解析