Re: Remove trailing blank lines at the end of a file
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Tue, 31 Mar 2009 19:15:53 -0500
Luk wrote:
On 30 Mar, 21:56, Iván Sánchez Ortega <ivansanchez-...@rroba-
escomposlinux.-.punto.-.org> wrote:
Luk wrote:I used trim. But without results. Other hints?$userfile holds the *contents* and not the *name* of the file, right?
Right??
You are writing the trimmed stuff back to the file, right?
Yes, should be. This is the code used:
if (move_uploaded_file($_FILES['uploaded_file']['tmp_name'],
$userfile)) {
echo 'OK';
}
then after the checks about the spaces and other chars, there's the
foreach cicle that works:
$lines = file($userfile);
foreach ($lines as $line_num => $line) {
//stuff
}
Luk
What is in the //stuff?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Prev by Date: Re: SOAP in PHP4?
- Next by Date: Re: can php replace javascript approach?
- Previous by thread: Re: SOAP in PHP4?
- Next by thread: Re: can php replace javascript approach?
- Index(es):
Relevant Pages
|