Help - Search - Members - Calendar
Full Version: Php Filesystem
BleepingComputer.com > Software > Programming
   
TheEndX
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.
groovicus
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. smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.