RE: [PHP] fwrite
| From: | Rick Emery | Date: | Mon, 11 Feb 2002 14:29:07 +0000 |
| Subject: | RE: [PHP] fwrite | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-84269@lists.php.net to get a copy of this message | ||
Does the file have to be formatted as text, or can it binary? If binary is
good, then you don't need fprintf() functionality.
-----Original Message-----
From: Scott [mailto:scott@scottah.com]
Sent: Monday, February 11, 2002 8:14 AM
To: Rick Emery
Cc: php-general@lists.php.net
Subject: RE: [PHP] fwrite
Thanks Rick, the sprintf would give me the formatting, but I am printing
out about 100 fields to this file on each loop and was looking for a
better way to include them as part of the statement. In other words, by
saying that NEWQUOTES is my file hadle, each line I would be able to do
this:
print NEWQUOTES "variables"
Thanks,
-Scott
On Mon, 11 Feb 2002, Rick Emery wrote:
> sprintf()
> then fwrite()
> -----Original Message-----
> From: Scott [mailto:scott@scottah.com]
> Sent: Monday, February 11, 2002 7:48 AM
> To: php-general@lists.php.net
> Subject: [PHP] fwrite
>
>
> Sorry for the simple questions, but I am converting this perl app to php
> and one of the things I do is write out a file doing this:
>
> open(NEWQUOTES, ">qiv_export.txt");
>
> Then when I want to write data to it I do this:
>
> printf NEWQUOTES ("%04d%02d%02d%-4s", report_time(), "0001");
>
> Is this possible with fwrite? It would be easier than:
> fwrite($exportfile, " ");
> fclose($logfile);
> and escaping all the double quotes.
>
> Thanks in advance.
>
> -Scott
>
>
>
--