Fwd: [PHP] Using PHP to remove certain number of bytes from file
- From: bddarwin@xxxxxxxxx ("Benjamin Darwin")
- Date: Sun, 30 Dec 2007 14:14:08 -0500
Maybe one of these days I'll remember to actually reply to the list the
first time.
---------- Forwarded message ----------
From: Benjamin Darwin <bddarwin@xxxxxxxxx>
Date: Dec 30, 2007 2:12 PM
Subject: Re: [PHP] Using PHP to remove certain number of bytes from file
To: Scott Wilcox <sc0tt@xxxxxxx>
Try this:
$file_data = file_get_contents('filename', false, null, 230);
file_put_contents('filename', $file_data);
This should do exactly what you need, although you may want to see if either
one returns false (indicating an error) and stop the script.
On Dec 30, 2007 12:20 PM, Scott Wilcox <sc0tt@xxxxxxx> wrote:
Is it possible with PHP to remove a certain number of bytes from a file,
purely within PHP?
If so, does someone have an example of doing this, removing the first
230 bytes from a file.
Thanks,
Scott.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Benjamin Darwin
bddarwin@xxxxxxxxx
"Dream as if you'll live forever, live as if you'll die today." ~James Dean
- Follow-Ups:
- Re: Fwd: [PHP] Using PHP to remove certain number of bytes from file
- From: Robert Cummings
- Re: Fwd: [PHP] Using PHP to remove certain number of bytes from file
- 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: Re: [PHP] script stoped working over christmas ?
- Next by Date: Re: [PHP] Using PHP to remove certain number of bytes from file
- Previous by thread: Using PHP to remove certain number of bytes from file
- Next by thread: Re: Fwd: [PHP] Using PHP to remove certain number of bytes from file
- Index(es):