Re: [PHP] Using PHP to remove certain number of bytes from file
- From: robert@xxxxxxxxxxxxx (Robert Cummings)
- Date: Sun, 30 Dec 2007 14:14:41 -0500
On Sun, 2007-12-30 at 17:20 +0000, Scott Wilcox wrote:
Is it possible with PHP to remove a certain number of bytes from a file,
purely within PHP?
Yes. Why wouldn't it?
If so, does someone have an example of doing this, removing the first
230 bytes from a file.
No, that's an awfully specific problem. But here's the tools you'll
need:
fopen(), fread(), fwrite(), fclose().
Further info... you could do this without creating a separate temporary
file (meaning shift bytes within a single file), but I suggest using a
temporary target file for writing the new content, and then replacing
the original once everything has completed successfully.
Cheers,
Rob.
--
............................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
............................................................
.
- References:
- [PHP] Comparison Problems with 5.2.5
- From: Magnus Anderson
- Re: [PHP] Comparison Problems with 5.2.5
- From: Silvio Porcellana
- Using PHP to remove certain number of bytes from file
- From: Scott Wilcox
- [PHP] Comparison Problems with 5.2.5
- Prev by Date: Fwd: [PHP] Using PHP to remove certain number of bytes from file
- Next by Date: Question about sqli class
- Previous by thread: Re: Fwd: [PHP] Using PHP to remove certain number of bytes from file
- Next by thread: Re: [PHP] Using PHP to remove certain number of bytes from file
- Index(es):