October 12th, 2000, 01:06 PM
I am using a tab delimited file to provide information for a page to be displayed. I have used fgetcsv() to get information from the file, and it returns an array of information. I was wondering if there is a way I could change information in the file. For example lets say that $content = "This" how could I change it so that, $content = "That". I know how to change the variable to a different value, but I haven't figured out how to change the actual file. Any ideas?
October 12th, 2000, 03:47 PM
read it change the array values and then write it back again
PHP/MySQL Enabled Hosting/Dedicated Servers
October 12th, 2000, 04:30 PM
here's the code I'm using to write to the file, I have gotten it to write to the file, but I want it to replace the contents of the file, not just append to it.
for($i=0; $i<=15; $i++)
$data_stuff = file("bio_data.data");
for($z=0; $z<=15; $z++)
print("<Font Face="Arial" Size="-2">$data_stuff[$z]</Font><BR>n");
October 12th, 2000, 04:38 PM
and it is writting to the file, except it is adding blank lines in wierd places, and it doesn't seem to be making any changes at all to the items that I wanted changes done to.
Any ideas are greatly appreciated.
[This message has been edited by mikeyt_333 (edited October 12, 2000).]