将php分解为不同的行

将php分解为不同的行,php,explode,Php,Explode,我有一个无法编辑的字符串。每个名称由一个, $json = explode(",", file_get_contents("http://api.easyjquery.com/ips/?ip=".$theirip."&full=true")); 我将它存储到一个txt文档中,就像一个测试项目一样。我在想,在我把它分解之后,我将如何使每个由a分隔的内容使用\n转到一个新行,这样它就不在一行上了 希望这有意义。使用: $result = implode("\n",$json); 你可以做

我有一个无法编辑的字符串。每个名称由一个

$json = explode(",", file_get_contents("http://api.easyjquery.com/ips/?ip=".$theirip."&full=true"));
我将它存储到一个txt文档中,就像一个测试项目一样。我在想,在我把它分解之后,我将如何使每个由a分隔的内容使用
\n
转到一个新行,这样它就不在一行上了

希望这有意义。

使用:

$result = implode("\n",$json);
你可以做:

$json = explode(",", file_get_contents("http://api.easyjquery.com/ips/?ip=".$theirip."&full=true"));
$text = implode("\n",$json);