0

我从网页复制以下字符串:

Reservation No.:    218662
Play Date:  Saturday - 4/11/2020
Course:     Truman  352-750-2374

我想打破 CRLF 并在我的数组中创建三行。在 2374 和 2020 之后有一个 CRLF (0D 0A)

我努力了

$lines = explode ("/n",$this->reservation);
$lines = explode ("/r/n",$this->reservation);
$lines = explode ("chr(10)",$this->reservation);
$lines = explode (chr(13.chr(10),$this->reservation);
$lines = explode (PHP_EOL,$this->reservation);

没有任何效果。

但是 nl2br 确实正确显示了字符串。

因此,似乎 nl2br 正在识别源字符串中的换行符,但爆炸不是。

我错过了什么?谢谢。

4

0 回答 0