当前位置:网站首页>PHP \ newline cannot be output
PHP \ newline cannot be output
2022-07-07 10:33:00 【zhang-php】
From the interface json Array , There is a newline in the text part of the array , use json_decode turn php After array , Output in html The page didn't wrap , At first, I thought that the newline symbol was deleted after the array was converted , Later, I tried various methods to replace characters , Finally, we found one CSS style :
white-space Property specifies how whitespace within an element is handled , The default value is normal( Blank will be ignored by browser )
Property value
| value | describe |
|---|---|
| normal | Default . Blank will be ignored by browser . |
| pre | Blank space will be reserved by browser . It behaves in a similar way HTML Medium <pre> label . |
| nowrap | Text does not wrap , The text will continue on the same line , Until I met <br> Label until . |
| pre-wrap | Keep blank sequence , But wrap normally . |
| pre-line | Merge whitespace sequence , But keep line breaks . |
| inherit | Rules should be inherited from the parent element white-space The value of the property . |
<td style="white-space:pre-wrap">{$vo.content}</td>After adding this attribute, the line will wrap automatically

边栏推荐
- 原型与原型链
- CC2530 ZigBee iar8.10.1 environment construction
- Talking about the return format in the log, encapsulation format handling, exception handling
- 使用Tansformer分割三维腹部多器官--UNETR实战
- [STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
- 搭建物联网硬件通信技术几种方案
- Remote meter reading, switching on and off operation command
- P1223 排队接水/1319:【例6.1】排队接水
- Trajectory planning for multi robot systems: methods and Applications Overview reading notes
- STM32 ADC and DMA
猜你喜欢

无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。

Several schemes of building hardware communication technology of Internet of things

多线程-异步编排

Some superficial understanding of word2vec

Leetcode-560: subarray with sum K

电表远程抄表拉合闸操作命令指令
![P1031 [noip2002 improvement group] average Solitaire](/img/ba/6303f54d652fa7aa89440e314f8718.png)
P1031 [noip2002 improvement group] average Solitaire

使用U2-Net深层网络实现——证件照生成程序
![[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program](/img/03/41bb3870b9a6c2ee66099abac08eb3.png)
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program

IO model review
随机推荐
ThreadLocal is not enough
路由器开发知识汇总
0x0fa23729 (vcruntime140d.dll) (in classes and objects - encapsulation.Exe) exception thrown (resolved)
leetcode-303:区域和检索 - 数组不可变
I'd rather say simple problems a hundred times than do complex problems once
BUUCTF---Reverse---reverse1
mysql插入数据创建触发器填充uuid字段值
[sword finger offer] 42 Stack push in and pop-up sequence
打算参加安全方面工作,信息安全工程师怎么样,软考考试需要怎么准备?
Prototype and prototype chain
JMeter loop controller and CSV data file settings are used together
Multithreaded asynchronous orchestration
IO模型复习
Serial communication relay Modbus communication host computer debugging software tool project development case
The width of table is 4PX larger than that of tbody
施努卡:机器视觉定位技术 机器视觉定位原理
Use the fetch statement to obtain the repetition of the last row of cursor data
IO model review
String formatting
宁愿把简单的问题说一百遍,也不把复杂的问题做一遍