Page 1 of 1

array to a file

Posted: Wed Jun 08, 2005 10:08 pm
by jaymoore_299
if I have an $myarray = array("one","two","three")
how what do I use as the glue for implode("?", $myarray)
so that when I write this string to a file and view it in notepad each element is on its own line?

try this

Posted: Wed Jun 08, 2005 10:09 pm
by neophyte
did you try "\n"

Posted: Thu Jun 09, 2005 12:28 am
by Syranide
I'd say "\r\n" if you use windows, as it would not show up as newlines in notepad etc otherwise. (but \n really does fine if you are not gonna read the file yourself)