On Tue, Jul 16, 2002 at 06:38:04PM -0400, Onaje Johnston wrote:
>
> It works using "if ($insert && isset($linenumber)) {".
>
> So because the value of linenumber is 0 on the first line, the if statement
> was evaluating to false and therefore the update wouldn't occur, correct?
Exactly. If sta
-Original Message-
From: Analysis & Solutions
Sent: Tuesday, July 16, 2002 4:40 PM
To: PHP List
Subject: Re: [PHP] Re: Editing files by line
On Tue, Jul 16, 2002 at 04:25:25PM -0400, Onaje Johnston wrote:
>>
>> if ($insert && $linenumber) {
>But, if $linenumb
On Tue, Jul 16, 2002 at 04:25:25PM -0400, Onaje Johnston wrote:
>
> if ($insert && $linenumber) {
But, if $linenumber is 0, this process won't happen. And, that was the
complaint you mentioned up front.
So, you should do an "isset($linenumber)" instead.
--Dan
--
PHP classes t
-Original Message-
>From: Analysis & Solutions
>Without seeing the script, it'd be hard for us to say. So, post the
>_relevant parts_ of the script to the list.
Here's the code:
I'm sorry, but I couldn't open a file!";
exit;
}
$array = file($file_name);
// this is the stuff w
On Mon, Jul 15, 2002 at 08:46:14PM -0400, Onaje Johnston wrote:
>
> I've written a script that edits a specific line in a text file and saves
> the changes to the file for that specific line. I've noticed though that I
> can't edit the first line in the file
Without seeing the script, it'd be har
-Original Message-
From: Analysis & Solutions
Sent: Friday, July 12, 2002 9:57 AM
To: PHP List
Subject: Re: [PHP] Re: Editing files by line
>Unfortunately, if a file is opened for appending via fopen('name', 'a'),
>the manual says the data is put at the
On Fri, Jul 12, 2002 at 12:04:55PM +0530, Lord Loh. wrote:
> int fseek (int fp, int offset [, int whence])
> int ftell (int fp)
> int rewind (int fp)
> These syntaxes might be useful...
> Read more in File System Functions of the PHP Docs.
Unfortunately, if a file is opened for appending via fope
int fseek (int fp, int offset [, int whence])
int ftell (int fp)
int rewind (int fp)
These syntaxes might be useful...
Read more in File System Functions of the PHP Docs.
Hope these help
Lord Loh.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/
8 matches
Mail list logo