PHP School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become a PHP Expert!

Join 307,148 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,731 people online right now. Registration is fast and FREE... Join Now!




file handling

 

file handling

shah khalid

6 Nov, 2009 - 03:35 AM
Post #1

New D.I.C Head
*

Joined: 6 Nov, 2009
Posts: 3

hello a i am a new member of this site.my quistion is how can we open multiple files in a sequence i.e one (do some processing and close it)then open the next and so on?
please help i am doing this task for the last 8 days but not completeed yet. thanks
shah khalid.[size=5

User is offlineProfile CardPM
+Quote Post


RudiVisser

RE: File Handling

6 Nov, 2009 - 05:23 AM
Post #2

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,891



Thanked: 139 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
The basic file methods open and close files.. fopen then fclose, etc.
User is offlineProfile CardPM
+Quote Post

BeatMasta A

RE: File Handling

8 Nov, 2009 - 05:23 AM
Post #3

New D.I.C Head
*

Joined: 8 Nov, 2009
Posts: 4


My Contributions
If the problem is to read and close many files at once, like MANY files from one directory, I would readdir() first, get list of files in an array, then make a loop for($i=0; $i<sizeof($myArray); $i++) which reads and closes each $myArray[$i] file like $handle = fopen($myArray[$i], "a+");

This post has been edited by BeatMasta A: 8 Nov, 2009 - 05:25 AM
User is offlineProfile CardPM
+Quote Post

shah khalid

RE: File Handling

9 Nov, 2009 - 08:55 PM
Post #4

New D.I.C Head
*

Joined: 6 Nov, 2009
Posts: 3

QUOTE(BeatMasta A @ 8 Nov, 2009 - 05:23 AM) *

If the problem is to read and close many files at once, like MANY files from one directory, I would readdir() first, get list of files in an array, then make a loop for($i=0; $i<sizeof($myArray); $i++) which reads and closes each $myArray[$i] file like $handle = fopen($myArray[$i], "a+");

thanks for replying.let me explain my problem a bit more than you we be able to answar exactly what i want .so here is the problem.
i have to open files from a directory in a text area element in my application.i want to check these files for duplicate contents one at a time.as for as checking one file it is easay.but when i want to perform these task on more than one files i have no idea how to open these fiels one by one and perform the duplication check on each of them.i want to open these files in controlled manner.i.e open one file perform the proceesing on it and than the next and so on.thanks.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/21/09 04:10PM

Live PHP Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month