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... 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"); 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 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... 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 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 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... 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'; Link to comment https://forums.phpfreaks.com/topic/84789-solved-fwrite-new-line/#findComment-432202 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.