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 different

[PHP] File handling and different character sets

2007-11-23 Thread Per Eriksson
Hi, I would like to know how you work with the PHP Directory Functions and different character sets. If I am having a professional view, well-written code should be able to handle file systems in different character sets. http://se.php.net/manual/sv/ref.dir.php Is there a way to write code for

[PHP] File-handling

2004-12-17 Thread gustav
Hi there! Can someone explain the major difference between fgets and fopen? Which is the best together with plain textfiles? and why? eof and feof. What's the difF? *don't get it* When using fget. Is it something special you should think when taking care of line-breaks? (/n, /r/n ...) /G --

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: ?php $handle = fopen(/tmp/inputfile.txt, r); while (!feof($handle)) { $buffer = fgets($handle, 4096); echo $buffer; } fclose($handle); ? Ian On Fri,

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 dumps,

[PHP] File handling

2003-02-13 Thread Kenneth Suralta
How do i delete all file in a directory??? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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

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

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: Jeff; [EMAIL PROTECTED] Subject: Re: [PHP] File

Re: [PHP] File handling

2002-11-29 Thread Jeff
]] Sent: 29 November 2002 04:29 To: Jeff; [EMAIL PROTECTED] Subject: Re: [PHP] File handling 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

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 first

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

[PHP] File handling

2002-11-28 Thread Jeff
Quick one, how do i read a file for a key word, say TEXt, and the delete the rest of the remaining file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

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, and

[PHP] File Handling

2002-05-15 Thread karthikeyan
Dear All, Greetings. Please let me know if the following can be done with php. All I need to do is this, Just assume that I have a text file with a separator like | It would be something like this ImagePath | DialogName | Dialog locationpath I have to read the text file of above

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 locationpath I have to read the text file of above format and display in the html file. pimg src =ImagePath1 a