Re: Deleting 1 file line
| From: | John Monfort | Date: | Wed, 16 May 2001 12:58:41 +0000 |
| Subject: | Re: Deleting 1 file line | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-53025@lists.php.net to get a copy of this message | ||
I don't know the code, but I would assume you could do the following:
1) read the file into an array, with each line as an element
2) search the element that has the line you're looking for...probably a
keyword
3) remove that element from the array
4) implode the array
5) rewrite the file with the same name, but with the content of the new
array.
Array keywords: shift, push, pop, etc..
I hope that helped.
__________John Monfort_________________
_+-----------------------------------+_
P E P I E D E S I G N S
www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-
On Wed, 16 May 2001, Tarrant Costelloe wrote:
> Does anyone know what the code is, if you wanted to specify a specific line
> in a file to delete and also to wipe clean the entire file?
>
> Thanks in advance!
>
> Taz
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>