0
file_put_contents($file, array_values($delivery[0]), FILE_APPEND);

That prints to file all values in the same row. How to print all values their own line?

1 Answer 1

2

You need to implode the values into a string, separated by (in your case) a new line.

file_put_contents(
    $file,
    implode("\n", array_values($delivery[0])),
    FILE_APPEND
);
Sign up to request clarification or add additional context in comments.

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.