Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 5th Mar 2010, 12:52 AM   #1
Warrior Member
 
Join Date: 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Help with fwrite command
Share on: 
fb share twitter share gplus share more share

Hi,

I am trying to use a PHP file to write another PHP file. I've got most of my code working, but I can seem to write the characters "/n". Every time I do, the PHP file just skips to the next line. I have tried printing "/" and the "n" with two separate fwrite commands, but this still does not work. How do I get around this problem?

Thanks,

bodyboard662 is offline  
Unread 5th Mar 2010, 01:32 AM   #2
Active Warrior
War Room Member
 
Join Date: 2007
Location: Orlando,FL , USA.
Posts: 60
Thanks: 3
Thanked 9 Times in 8 Posts
Default
Re: Help with fwrite command
Share on: 
fb share twitter share gplus share more share

Does \\n work?

Later,
Dan

Dan Liptak is offline  
Unread 5th Mar 2010, 03:06 AM   #3
Steve Hawkins
War Room Member
 
TrafficMystic's Avatar
 
Join Date: 2009
Location: Whitleybay, uk
Posts: 1,880
Thanks: 67
Thanked 1,125 Times in 221 Posts
Blog Entries: 3
Default
Re: Help with fwrite command
Share on: 
fb share twitter share gplus share more share

It looks like your using the wrong end of line character, as dan says try --> \n in place of /n

TrafficMystic is offline  
Unread 5th Mar 2010, 07:26 AM   #4
Warrior Member
War Room Member
 
Join Date: 2010
Location: Brisbane, Australia
Posts: 15
Thanks: 0
Thanked 2 Times in 2 Posts
Default
Re: Help with fwrite command
Share on: 
fb share twitter share gplus share more share

As you have found, the \n has a special meaning (new line).

To get around this try:-
1) Escape the slash '\' by using a double slash '\\', i.e. \\n (as said by Dan above)
or
2) Enclose the string in single quotes rather than double quotes.

PS: I'm assuming here that in your post that you meant \ instead of /
TheWorker is offline  
Unread 5th Mar 2010, 11:28 AM   #5
Lisa Dozois
War Room Member
 
lisag's Avatar
 
Join Date: 2006
Location: Florida, USA.
Posts: 608
Thanks: 107
Thanked 254 Times in 118 Posts
Default
Re: Help with fwrite command
Share on: 
fb share twitter share gplus share more share

fwrite and newline?

-- Lisa G
lisag is offline  
Closed Thread


Bookmarks

Tags
command, fwrite


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 05:28 PM.