我正在尝试拆分空行。
这是我的字符串变量:
$string = '
Hello,
Just test lines
Second test lines
';
我想要这些结果:
$OUTPUT[0]='HELLO,';
$OUTPUT[1]='Just test lines
Second test lines';
我的代码:
$a = explode("\n\n",$string);
print_r($a);
我的领域结果:
Array ( [0] => Hello, Just test lines Second test lines )
\n
吗? - David Laberge"\r\n\r\n"
看看是否有效。 - cdhowie\r\n\r\n
而不是\n\n
。 - Joe