如何用php逐行拆分html中的数据?

时间:2019-05-06 02:34:03

标签: php html

我希望停止在代码中使用“ br”,但是在删除代码中的“ br”标记后,我无法逐行使用。为什么要删除“ br”?因为里面的商品数据是通过电子商务的在线购物网站,如果我使用“ br”标签。它告诉我错误。这样我就必须删除“ br”标签。

以下是删除我目前拥有的html中的br的代码:

$product_description = strip_tags($product_description);
echo "$product_description";

这会给我输出(不是逐行显示):

1 unit of 3M 3200, individual packagingRespirator only, not including 
cartridge or filterMaterial: ThermoplasticKOSHA StandardLow profile design 
allows a wide field of visionLightweight makes long period of wear 
bearableSoft, elastomeric face-fit secures a lasting comfortUnique easy to 
don/doff strap systemThe 3M™ Reusable Half Face Mask Respirator 3200. 
Features include: An elastomeric face seal, M/L in size, it is a compact 
and lightweight half mask that offers an economical solution for a range 
of applications

实际上,我希望输出像下面的每一行一样:

1 unit of 3M 3200, individual packaging
Respirator only, not including cartridge or filter
Material: Thermoplastic
KOSHA Standard
Low profile design allows a wide field of vision
Lightweight makes long period of wear bearable
Soft, elastomeric face-fit secures a lasting comfort
Unique easy to don/doff strap system
The 3M™ Reusable Half Face Mask Respirator 3200. Features include: An 
elastomeric face seal, M/L in size, it is a compact and lightweight half 
mask that offers an economical solution for a range of applications

希望有人可以帮助我解决这个问题。谢谢。

0 个答案:

没有答案