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.
Page 1 of 1
Php Filesystem I need some methods that I can use to do this...
#2
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.
"Take the risk of thinking for yourself, much more happiness, truth, beauty, and wisdom will come to you that way" - Christopher Hitchens
Share this topic:
Page 1 of 1

Help

Back to top









