Jump to content


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.


Php Filesystem

  • Please log in to reply
1 reply to this topic

#1 TheEndX


  • Members
  • 4 posts
  • Local time:10:02 AM

Posted 03 March 2008 - 11:45 PM

I believe that PHP's filesystem will fit what I want to do but I am having trouble finding the appropiate items to do the following:

-Delete a selected line from a text file (For Example: Remove line 40 of a 100 line text file. Therefore, what was line 41 is now line 40 and there are now 99 lines in total)

-Add a line to a preexisting text file (For Example: A string is added to the end of the file [A 98 line text file becomes 99 line] or a string is inserted at a selected line of in the file[The string is made line 45 and what was previously line 45 becomes line 46])

-Edit/replace a certain line in a preexisting text file (For Example: Line 34 which says "Hello I am sam" is changed to say "This is John")

If any of you know a function or a method that can do either of these, do tell.

BC AdBot (Login to Remove)


#2 groovicus


  • Security Colleague
  • 9,963 posts
  • Gender:Male
  • Location:Centerville, SD
  • Local time:08:02 AM

Posted 04 March 2008 - 07:20 AM

We generally don't answer questions like that, because then you don't learn anything. What we will do is look at how you think these tasks can be accomplished, and help guide you to find the solution. These are typical problems you would answer for any programming class, so it is important that you learn this yourself. :thumbsup:

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users