pugboy Posted June 10, 2008 Share Posted June 10, 2008 For one of the scripts, I need to be able to delete a few lines of a text file... The issue is, if one line is deleted, then all of the other numbers will change... How would I do this? I have a page with checkboxes set up in an array (delete[1], delete[2], etc...) Link to comment https://forums.phpfreaks.com/topic/109661-deleting-lines-in-a-text-file/ Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 Why not just use a database? >_> EDIT: I mean, you can fill the "deleted" line with a newline char if you want... Link to comment https://forums.phpfreaks.com/topic/109661-deleting-lines-in-a-text-file/#findComment-562653 Share on other sites More sharing options...
pugboy Posted June 10, 2008 Author Share Posted June 10, 2008 Well, I haven't learned how to use MySQL for one... I actually need the line deleted, because the file would fill up with empty lines... Link to comment https://forums.phpfreaks.com/topic/109661-deleting-lines-in-a-text-file/#findComment-562654 Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 Well then you need to deal with the line numbers changing. And learn to use MySQL. Link to comment https://forums.phpfreaks.com/topic/109661-deleting-lines-in-a-text-file/#findComment-562656 Share on other sites More sharing options...
pugboy Posted June 10, 2008 Author Share Posted June 10, 2008 Ugh... I guess I can use Javascript to tell when a checkbox has been checked, then delete the line and efresh the page. Link to comment https://forums.phpfreaks.com/topic/109661-deleting-lines-in-a-text-file/#findComment-562657 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.