PHP line break with file_put_contents()

Posted by steve-o on Stack Overflow See other posts from Stack Overflow or by steve-o
Published on 2010-05-10T16:49:41Z Indexed on 2010/05/10 16:54 UTC
Read the original article Hit count: 176

Filed under:
|

I can't seem to figure out why the following code doesn't produce a new line in my text file - neither does using \n etc either - any ideas what could be wrong?

    $data = $name . ' | ' . $_POST['comment'] . PHP_EOL;

    //write to file
    $f = file_put_contents('posts.txt', $data, FILE_APPEND);

© Stack Overflow or respective owner

Related posts about php

Related posts about web-development