nutt318 Posted February 11, 2009 Share Posted February 11, 2009 I am pulling $email from another page and it stores it in the variable and the below command does work and write to the file. My problem is how do I make the following code do a new line after the $text? I know that if it was just normal text i could do "my text here \n" Which works, but I have this variable and I need it to do the same. But the \n doesnt work after my variable. Is there another option or way to do this? Thanks $open = fopen("email.txt","a+"); $text = $email; fwrite($open, $text); fclose($open); Quote Link to comment https://forums.phpfreaks.com/topic/144786-solved-fwrite-new-line-after-variable/ Share on other sites More sharing options...
printf Posted February 11, 2009 Share Posted February 11, 2009 use a the concentration, (dot) operator... fwrite ( $open, $text . "\n" ); Quote Link to comment https://forums.phpfreaks.com/topic/144786-solved-fwrite-new-line-after-variable/#findComment-759754 Share on other sites More sharing options...
nutt318 Posted February 11, 2009 Author Share Posted February 11, 2009 And I was so close to figuring it out, I just needed the . (dot) Thanks Printf Quote Link to comment https://forums.phpfreaks.com/topic/144786-solved-fwrite-new-line-after-variable/#findComment-759764 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.