/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] frwite issue

Hi

I am using frwite to write to a text file but i cant seem to get n to work…

here is my code:

$file = “Add this to then file”;

$fileHandle = fopen($fileName, ‘w’) or die(“can’t open file”);

fwrite($fileHandle, $file);

the result i get is just

Add this to the file

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@MindzaiMay 14.2009 — How are you viewing the file? Which program are you using? Which OS are you using?
Copy linkTweet thisAlerts:
@paulnicauthorMay 14.2009 — im viewing the file in notepad and my os is xp
Copy linkTweet thisAlerts:
@FRKTMay 14.2009 — I think Windows reads newlines as rn or the other way around. I'm not entirely sure, but I'd say it's worth a try.
Copy linkTweet thisAlerts:
@paulnicauthorMay 14.2009 — thanks man this worked! rn

cheers
×

Success!

Help @paulnic 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...