Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 03-17-2004, 08:36 AM   #1
Member (2 bit)
 
Join Date: Mar 2004
Location: EarthPlanet
Posts: 2
Writing to a file. (PHP)

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.
Nasimov is offline   Reply With Quote
Old 03-17-2004, 09:58 AM   #2
PCMech Founder
Staff
 
drisley's Avatar
 
Join Date: Mar 1999
Location: Tampa, FL
Posts: 1,950
Send a message via ICQ to drisley
You would need to do a string search of the string to find the position in the file (with strpos() or something like that), then yes, you could do it.
drisley is offline   Reply With Quote
Old 03-17-2004, 11:08 AM   #3
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
You can do it but in general it is not a great idea since it will become quite slow as the .txt file grows. Your best bet is always to store the data in a database.
mairving is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

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



All times are GMT -5. The time now is 12:50 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2