Jump to content

Read specific line from text file using PHP


johnymap

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.