Nasimov
03-30-2004, 08:55 AM
It's possible to ammend data within a file vs. just adding data to the beginning or the end of the file? Mean to change something in the "middle" of the file.
Thanks.
l0rdphi1
03-30-2004, 08:58 AM
Yes, you can, I'd do something like this:
$s_fdat = file_get_contents('thefile');
$s_fdat = str_replace("search","replace",$s_fdat);
$fp = fopen('thefile','w');
flock($fp,2);
fwrite($fp,$s_fdat);
fclose($fp);
Powered by vBulletin™ Version 4.0.4 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.