PDA

View Full Version : PHP: add to end of the file


MacroDENIS
11-10-2002, 09:04 AM
Hi all !!!

I am begginner and I have one problem.
I want to add to end of the file, for example 'base.txt' some text, for example 'hello world'.

Do you happen to know how I can do it?

Can anyone help me?

whackaxe
11-10-2002, 09:23 AM
$dafile=fopen("base.txt","a+");
fwrite($dafile, "hello world!");


that should do the job

MacroDENIS
11-10-2002, 09:35 AM
Originally posted by whackaxe

$dafile=fopen("base.txt","a+");
fwrite($dafile, "hello world!");


that should do the job

Thanks a lot !!!
:thumbsup:

whackaxe
11-10-2002, 12:14 PM
ccheck out PHP.net's documentation of fopen for the 6 (7 counting binary) differnt read/write modes