You are here: End of line-new line « PHP Programming Language « IT news, forums, messages
End of line-new line

Posted by Sheldon Glickler on 10/22/20 11:40

I have what I thought was a simple task. I have a file with an orderd list
in it that I use in a readfile to generate an html page. When I want to
insert a new entry into that list, it should be in the proper place. My
procedure is to create an array using file('filename'). I then search in
that list for the proper placement, writing each line to a target file with
an fwrite command. I write the new line and then I write the rest of the
array. Simple, yes?

Well, all the lines that I generated with the file command write back
perfectly. I cannot seem to get the new entry to generate a line
feed-carriage return. This is on a Windows system. I have tried "\n" and
have "\r\n" and even nothing at all. No success. I have temporarily done a
work-around by having the first line of the original file be blank and
appending $lines[0] to the new entry where $lines is the array I generated.

Any ideas? I would like to solve this the correct way.

Note: I added the formatting as follows
fwrite($handle, "The new entry information\r\n");

Shelly

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация