maxudaskin Posted January 6, 2008 Share Posted January 6, 2008 How can I put a new line into a file using fwrite? I tried <br /> but it didn't work... Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/ Share on other sites More sharing options...
Ken2k7 Posted January 6, 2008 Share Posted January 6, 2008 fwrite("new line baby! \r\n"); Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432183 Share on other sites More sharing options...
redarrow Posted January 6, 2008 Share Posted January 6, 2008 \r\n windows version \n new line linux version Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432187 Share on other sites More sharing options...
maxudaskin Posted January 6, 2008 Author Share Posted January 6, 2008 I knew that... I just didn't remember it... Thanks... Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432189 Share on other sites More sharing options...
maxudaskin Posted January 6, 2008 Author Share Posted January 6, 2008 Didn't work... http://www.virtualzoom.net/ops/fplns/OOM0100_CYYZ-EGKK_6%20January%202008_1525%2025.txt Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432193 Share on other sites More sharing options...
redarrow Posted January 6, 2008 Share Posted January 6, 2008 post your code please Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432196 Share on other sites More sharing options...
maxudaskin Posted January 6, 2008 Author Share Posted January 6, 2008 This is what I got so far... $my_t=getdate(date("U")); echo '<span class="fpln">'; echo 'OOM'.$_SESSION["username"].' '.$_POST['dept'].'-'.$_POST['dest'].' '.$my_t[mday].'.'.$my_t[month].'.'.$my_t[year].'/'.$my_t[hours].''.$my_t[minutes]; echo '<br />'; echo '</span>'; $text = $_SESSION["username"].' '.$_POST['dept'].'/'.$_POST['dest'].' '.$my_t[mday].'.'.$my_t[month].'.'.$my_t[year].'_'.$my_t[hours].''.$my_t[minutes].' \n Line 2'; $filename = 'OOM'.$_SESSION["username"].'_'.$_POST['dept'].'-'.$_POST['dest'].'_'.$my_t[mday].' '.$my_t[month].' '.$my_t[year].'_'.$my_t[hours].''.$my_t[minutes].' '.$my_t[minutes].'.txt'; $file = fopen("../ops/fplns/".$filename,"w"); echo fwrite($file,$text); fclose($file); echo '<a href="fplns/'.$filename.'">Download Flight Plan</a>'; It shows the information then inserts it into the txt file... Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432200 Share on other sites More sharing options...
maxudaskin Posted January 6, 2008 Author Share Posted January 6, 2008 I just pressed enter... it worked... $text = $_SESSION["username"].' '.$_POST['dept'].'/'.$_POST['dest'].' '.$my_t[mday].'.'.$my_t[month].'.'.$my_t[year].'_'.$my_t[hours].''.$my_t[minutes].' Line 2'; Quote Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432202 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.