I m simply experimenting with PHP to prepare me for some upcoming projects and I ve encountered a string which won t have <br />
inserted into it even though it is a multi-line string.
该守则是简明的购买力平价(I ve 载于简单的html标签)。
$ping = passthru( ping www.google.com );
$ping = htmlspecialchars_decode($ping);
$ping = strip_tags($ping);
$ping = nl2br($ping);
echo $ping;
结果是多线铺设,但无任何<条码>和>;br /> 标签,但页数显示,由于双向线铺设,因此该带的条形形形形形色,但<条码>nl2br(>>没有做任何事情。
Page source (which has mysteriously added extra whitespace lines when I pasted it in here)
<html>
<head>
<title>Derp</title>
</head>
<body><p>
Pinging www.l.google.com [209.85.227.147] with 32 bytes of data:
Reply from 209.85.227.147: bytes=32 time=44ms TTL=48
Reply from 209.85.227.147: bytes=32 time=28ms TTL=48
Reply from 209.85.227.147: bytes=32 time=40ms TTL=48
Reply from 209.85.227.147: bytes=32 time=29ms TTL=48
Ping statistics for 209.85.227.147:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 28ms, Maximum = 44ms, Average = 35ms
</p>
</body>
</html>
网页上的实际插图:
Pinging www.l.google.com [209.85.227.147] with 32 bytes of data: Reply from 209.85.227.147: bytes=32 time=30ms TTL=48 Reply from 209.85.227.147: bytes=32 time=29ms TTL=48 Reply from 209.85.227.147: bytes=32 time=28ms TTL=48 Reply from 209.85.227.147: bytes=32 time=31ms TTL=48 Ping statistics for 209.85.227.147: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 28ms, Maximum = 31ms, Average = 29ms
在广泛征求所有我的意见之后,可以发现的是那些不使用<代码>nl2br()的人。
我在这里失踪了吗?