1

I have a string that I cannot edit. each name is separated by a ,

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

I am storing this into a txt document just as a test project. I was wondering after I explode it how would I would make each content that was seperated by a , to go to a new line using \n so it isn't all on one line.

hope this made sense.

2 Answers 2

1

Use :

$result = implode("\n",$json);
Sign up to request clarification or add additional context in comments.

Comments

1

You can do:

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.