RE: [PHP] File handling and different character sets

2007-11-24 Thread Andrés Robinet
> -Original Message- > From: Per Eriksson [mailto:[EMAIL PROTECTED] > Sent: Friday, November 23, 2007 7:15 AM > To: php-general@lists.php.net > Subject: [PHP] File handling and different character sets > > Hi, > > I would like to know how you work with the PHP Directory Functions and > di

Re: [PHP] File-handling

2004-12-17 Thread Richard Lynch
[EMAIL PROTECTED] wrote: > Hi there! > > Can someone explain the major difference between fgets and fopen? Which is > the best together with plain textfiles? and why? fgets can be handy to read a large file one LINE at a time. This is most useful in files that are line-based, such as SQL data dum

Re: [PHP] File-handling

2004-12-17 Thread Ian Firla
fgets uses the resource created by fopen. Read the manual: http://it.php.net/fopen http://it.php.net/fgets look at the example: Ian On Fri, 2004-12-17 at 11:24 +0100, [EMAIL PROTECTED] wrote: > Hi there! > > Can someone explain the major difference between fgets and fopen? Which is > the

Re: [PHP] File handling

2003-02-13 Thread Kevin Waterson
This one time, at band camp, Kenneth Suralta <[EMAIL PROTECTED]> wrote: > How do i delete all file in a directory??? bit ugly but... function del_dir($dirname) { $dh = opendir($dirname); while(false !== ($file = readdir($dh))) { if($file != '.' && $file != '..') {

RE: [PHP] File handling

2003-02-13 Thread Tony Crockford
> How do i delete all file in a directory??? > You could use a function like this: (html code at end) function delFiles($filter, $sDir) { $cDirectory = includeTrailingSlash($sDir); $handle = opendir($cDirectory); while ($file = readdir($handle)) { if ($file == '.' || $

Re: [PHP] File handling

2002-11-29 Thread Maxim Maletsky
loop through the file line by line explode()ing every line with "TEXt" in it. Then, if retrning array count is bigger than one, unset() the key one and break the loop. All read OVERWRITE in the original file. Sorry, too lazy writing the code here :) -- Maxim Maletsky [EMAIL PROTECTED] "Jeff"

Re: [PHP] File handling

2002-11-29 Thread Justin French
on 29/11/02 7:06 PM, Jeff RingRose ([EMAIL PROTECTED]) wrote: > Justin, > Option b. delete all AFTER "foo", I.E. truncate the file directly after > "foo". Leaving "foo" and all the data before "foo" untouched. And what happens if there are more than one occurrence of "foo"? I assume you mean the

Re: [PHP] File handling

2002-11-29 Thread Jeff
t; and all the data before "foo" untouched. > > Jeff > > -Original Message----- > From: Justin French [mailto:[EMAIL PROTECTED]] > Sent: 29 November 2002 04:29 > To: Jeff; [EMAIL PROTECTED] > Subject: Re: [PHP] File handling > > > > Quick one, how do

RE: [PHP] File handling

2002-11-29 Thread Jeff RingRose
Justin, Option b. delete all AFTER "foo", I.E. truncate the file directly after "foo". Leaving "foo" and all the data before "foo" untouched. Jeff -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: 29 November 2002 04:29 To: J

Re: [PHP] File handling

2002-11-28 Thread Justin French
> Quick one, how do i read a file for a key word, say "TEXt", and the delete > the rest of the remaining file? Do you mean: a) how do i make sure a word (eg "foo") is in a file, and if it is, delete all contents of the file except the word "foo" OR b) how do i search a file for the word "foo",

Re: [PHP] File Handling

2002-05-15 Thread Miguel Cruz
On Thu, 16 May 2002, karthikeyan wrote: > Just assume that I have a text file with a separator like "|" > > It would be something like this > > "ImagePath" | "DialogName" | "Dialog location" > > I have to read the text file of above format and display in the html file. > > DialogName1