![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: looping and writing to a file
From: Ken Robinson <kenrbnsn@rbnsn.com>
Date: Mon Jul 18 2005 - 06:11:37 CEST
Aaron Reimann wrote (in part):
You know you can write those two lines on one line.
global $sys_install_base, $sys_relative_uploaddir;
>
You don't need parenthesis on an echo statement.
> I need some help writing the info to a text file. I know the 'fopen'
If you know about fopen and fwrite, what's your problem?
$fp = fopen('your.file','w');
Just replace your echo statements with fwrite statements and make sure
BTW, this echo statement:
echo ("<song title=\"{$r['song_title']}\" artist=\"{$r['artist']}\"
can be written much more cleanly, something like:
echo '<song title="' . $r['song_title'] .'" artist="' . $r['artist'] .
Ken
|