Re: Get directory items, read file lines...
| From: | Joseph W. Goff | Date: | Thu, 22 Aug 2002 15:24:12 +0000 |
| Subject: | Re: Get directory items, read file lines... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-113632@lists.php.net to get a copy of this message | ||
1) readdir();
2) $your_file = file($filename); $your_line=$your_file[$your_line_number]
3) $fp = fopen($filename,'w');
fputs($fp,$your_text);
fclose($fp);
In the second argument to fopen, w = write, a = append, r = read
See the manual for more info on these functions.
----- Original Message -----
From: "Bill Leonard" <bill@machinemen.com>
To: <php-general@lists.php.net>
Sent: Thursday, August 22, 2002 10:15 AM
Subject: [PHP] Get directory items, read file lines...
> Hey all,
>
> Pretty new to PHP... A couple of general questions will help me solve a
> larger problem...!
>
> 1) I need to read all of the names of the files in a given directory
>
> 2) read a given line number out of each of these files (just text)
>
> 3) write it to a delimited file of some sort
>
> I think I am on to #2 and #3, but #1 I am having trouble with... Any
> pointers would be appreciated!
>
>
> --
> Bill Leonard bill@machinemen.com
> www.machinemen.com 407.464.0147
>
> XrackHosting.com - Mac OS X hosting on Apple's Xserve!
> http://www.xrackhosting.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>