2012-08-02 44 views
1

我有一個我無法編輯的字符串。每個名稱由,將php分解成不同的行

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

我存入一個txt文檔這只是一個測試項目分離。我想知道爆炸之後,我會如何讓每個被a隔開的內容,使用\n去一個新的行,所以它不是全部在一行上。

希望這是有道理的。

回答

1

用途:

$result = implode("\n",$json); 
1

你可以這樣做:

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