I do this to get file content into array:
$array = file('sample.txt', FILE_IGNORE_NEW_LINES);
How to reverse this? If I have the array already how to write it to a file, each value in a seperate line.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It would not make sense to put each value on a different row. You’re probably looking for serialize.
If you really want each element on it’s own line, you could use implode: