Re: [PHP] fopen

This is a discussion on Re: [PHP] fopen within the PHP General forums, part of the PHP Programming Forums category; On Sunday 28 December 2003 11:17 pm, Cesar Aracena wrote: > $fp = fopen("../files/welcome.txt", "...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-29-2003
Gerard Samuel
 
Posts: n/a
Default Re: [PHP] fopen

On Sunday 28 December 2003 11:17 pm, Cesar Aracena wrote:
> $fp = fopen("../files/welcome.txt", "a+");
>


Change to
$fp = fopen("../files/welcome.txt", "r");

Use "r" to read, when you use "a" it appends (or adds) to the file
Its also suggested to use the "b" option to so it would look like
$fp = fopen("../files/welcome.txt", "rb");

That is done for portability between *nix and windows.

More info is at the manual
http://us2.php.net/manual/en/function.fopen.php
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:41 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0