johnymap Posted January 16, 2008 Share Posted January 16, 2008 The text file i am using has the following format: "2001_1.rtf" (1 January 2001) Ookame v Tombale (CCF No. 203 of 2001) [2001] BWHC 1 "2001_2.rtf" (1 January 2001) Kgaimena v Leoifo (MISCA F.572 of 2001) [2001] BWHC 2 "2002_1.rtf" (7 June 2002) Olebeng v The State (C A No. F104 of 2001) [2002] BWHC 1 "2003_1.rtf" (1 January 2003) Sebogodi v Sebogodi (Matrimonial Cause No.F68 of 2003) [2003] BWHC 1 So i have a dropdown form object populated with years, if the user select 2001(for eg.) on the form, I have to read the last value of that year from the text file which is: "2001_2.rtf" (1 January 2001) Kgaimena v Leoifo (MISCA F.572 of 2001) [2001] BWHC 2 do some processing and write back some new data to the text file under this specific line not at the end of file. Please help me Quote Link to comment https://forums.phpfreaks.com/topic/86268-read-specific-line-from-text-file-using-php/ Share on other sites More sharing options...
monkeytooth Posted January 16, 2008 Share Posted January 16, 2008 Curious, why not switch up from flat file to mysql? you could do the same thing, but much easier, much more specific, and more.. Quote Link to comment https://forums.phpfreaks.com/topic/86268-read-specific-line-from-text-file-using-php/#findComment-440899 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.