/    Sign up×
Community /Pin to ProfileBookmark

How do I get newline characters

Im tyring to output information to a file. I want to have a newline character at the end of each line so that the next string that is written to the file starts on the next line. I coded it as below but it didnt work, I get all the outputs on the same line with the n in between each string. What did I do wrong?

$writefile1=’Name:’.$name.’ / Address:’.$address.’n’;
$writefile2=’Question: ‘.$question.’ submitted on ‘.$dte.’n’;
fputs($fp,$writefile1);
fputs($p,$writefile2);

where $fp is the file that is opened for writing to.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@SpectreReturnsNov 18.2005 — "n" is a newline

'n' is not
×

Success!

Help @shashgo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...