Page 1 of 1
Using flat text files
Posted: Tue May 16, 2006 4:58 am
by spudmclard
Can anybody give me a pointer on what i would have to do to enable me to take an entry from one flat text file and move it to another.
ie.
FILE1 FILE2
a
b
c
to end up
FILE1 FILE2
a b
c
Sorry for being vague.
Re: Using flat text files
Posted: Tue May 16, 2006 11:32 am
by aerodromoi
spudmclard wrote:Can anybody give me a pointer on what i would have to do to enable me to take an entry from one flat text file and move it to another.
ie.
FILE1 FILE2
a
b
c
to end up
FILE1 FILE2
a b
c
Sorry for being vague.
reading:
Code: Select all
$file= "xyz.dta";
$fp = fopen ($file, "r" );
$olddata = fread ($fp, filesize($file));
fclose ($fp);
writing:
Code: Select all
$access = fopen ($file, "w" );
fwrite ($access, $string, 800000 );
fclose ($access);
You'll have to chmod the file xyz.dta accordingly!
aerodromoi