|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I am writing information to text file. Could anyone tell me if it is possible to search for particular parts of the file and edit or delete them? Many thanks Daniel |
|
#2
|
||||
|
||||
|
Depends on what exact sort of editing you want to do. If, for example, you wanted to convert all instances of string A within a file to string B, then it's simple: just use preg_replace() to search for string A and do the replacement. (Of course, in order to do this, you'd open the file, read the contents into a variable, perform the operation on the variable, and rewrite the updated content to the file.) If you've got other ideas in mind, you'll need to be a little more specific.
|
|
#3
|
|||
|
|||
|
Many thanks for your reply, that is just the sort of thing I was looking for.
Cheers Daniel |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Write/Edit/Delete information from text files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|