小编Ema*_*oom的帖子

爆炸空行

我试图爆炸空行.

这是我的字符串变量:

$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)

php string explode

4
推荐指数
1
解决办法
3718
查看次数

标签 统计

explode ×1

php ×1

string ×1