bencohen Posted October 9, 2009 Share Posted October 9, 2009 If I have a list of say 1000 voucher codes, one on each line of a text file, how do I issue one to a user and then delete that code from the list so that it is never given to more than 1 person? Ideally I want to email it to them when they register to use our website. I did have some code that did this years ago but have lost it! Link to comment https://forums.phpfreaks.com/topic/177092-displaying-one-line-of-a-text-database-and-then-deleteing-it/ Share on other sites More sharing options...
Bricktop Posted October 9, 2009 Share Posted October 9, 2009 Hi bencohen, I've used this custom function a few times in the past which may help. You'd have to use PHP's count() function to count the lines in the text file and then you can specifiy which line you want to remove from the text file. Hope this helps. Link to comment https://forums.phpfreaks.com/topic/177092-displaying-one-line-of-a-text-database-and-then-deleteing-it/#findComment-933735 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.