Connecting Tech Pros Worldwide Help | Site Map

Newline doesn't work for some reason?

  #1  
Old January 29th, 2006, 01:55 PM
Ralph Höglund
Guest
 
Posts: n/a
The \n I write out to an open file does not work
the second time:

$xmlstr = "<?xml version=\"1.0\"\x3F>\n";
$songstr = "<songs>\n";

fwrite($handle, "$xmlstr"); //after this I got a new line
fwrite($handle, "$songstr"); //but not after this

$lines = file("./clips/$file_name");
foreach ($lines as $line_num => $line) {

fwrite($handle, " <song path=\"$line");
}

The output:

<?xml version="1.0"?>
<songs> <song path="http://209.245.59.124/song.mp3

Should be:

<?xml version="1.0"?>
<songs>
<song path="http://209.245.59.124/song.mp3


How come??

Ralph
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Requesting advice how to clean up C code for validating string represents integer robert maas, see http://tinyurl.com/uh3t answers 232 April 16th, 2007 04:55 AM
Smarter way to do this? Unicode + stdin, stdout BenjaMinster answers 1 December 17th, 2006 09:25 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit answers 5 November 14th, 2005 12:36 PM
Matching neighbouring words of a pattern using Regex CV answers 2 July 19th, 2005 06:13 AM