You are here: Re: Newline doesn't work always....?? « PHP Programming Language « IT news, forums, messages
Re: Newline doesn't work always....??

Posted by Jonathan on 11/18/06 11:38

Ralph Höglund wrote:
> 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

I don't know what is the solution to your problem, but you certainly do
not have to surround variables with quotes to write them to a file. This
would do:

fwrite($handle, $xmlstr);

If you want to insert a variable in a string then you need quotes:

fwrite($handle, "The contents of this string is $xmlstr");

> $lines = file("./clips/$file_name");
> foreach ($lines as $line_num => $line) {
>
> fwrite($handle, " <song path=\"$line"); //$line is from another file
> containing path and song text.

And I guess this line should read

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

Jonathan

 

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

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