97 posts
Location
Ohio, USA
Posted 22 June 2013 - 10:22 PM
I'm making a multi line file that needs to be creating multiple lines, however, I'm not sure how to do it. Here is the line of code.
file_put_contents("teams/$teamCreate/info.txt","$teamCreate\n$adminEmail\n$password");
4 posts
Posted 22 June 2013 - 10:32 PM
You could use "\r\n", but that's not good for cross-platform compatibility. (I'll give a more in-depth explanation if you like.) Instead, use PHP_EOL like so:
"first line".PHP_EOL."second_line"
97 posts
Location
Ohio, USA
Posted 22 June 2013 - 10:41 PM
You could use "\r\n", but that's not good for cross-platform compatibility. (I'll give a more in-depth explanation if you like.) Instead, use PHP_EOL like so:
"first line".PHP_EOL."second_line"
Thanks Skydyn! it works! :D/>
7508 posts
Location
Australia
Posted 22 June 2013 - 10:58 PM
You could use "\r\n", but that's not good for cross-platform compatibility.
But it is much better than just using '\n' or '\r'.