我试图爆炸空行.
这是我的字符串变量:
$string = '
Hello,
Just test lines
Second test lines
';
Run Code Online (Sandbox Code Playgroud)
我想要这些结果:
$OUTPUT[0]='HELLO,';
$OUTPUT[1]='Just test lines
Second test lines';
Run Code Online (Sandbox Code Playgroud)
我的代码:
$a = explode("\n\n",$string);
print_r($a);
Run Code Online (Sandbox Code Playgroud)
我的领域结果:
Array ( [0] => Hello, Just test lines Second test lines )
Run Code Online (Sandbox Code Playgroud)