[!--quoteo(post=381907:date=Jun 9 2006, 04:51 PM:name=Fyorl)--][div class=\'quotetop\']QUOTE(Fyorl @ Jun 9 2006, 04:51 PM) [snapback]381907[/snapback][/div][div class=\'quotemain\'][!--quotec--] foreach($array as $key => $value) is not needed in this instance as the $key is useless for this loop, all that's needed is the value which can be obtained by foreach($array as $value) Also, if you're calling a function my_BossSaysI_CanGoHome_now(), it won't be able to do anything to the line because it doesn't have anything passed to it. If it's going to affect the line you need to pass it to the function like my_BossSaysI_CanGoHome_now($line); [/quote] Dear Fyorl, I have tried exactly the way you have mentioned in your post as below. $array = file('info.txt'); echo "<pre>"; var_dump($array); // see if it's worked echo "</pre>"; foreach($array as $line) { My code to check database for items through text file. } I have checked the info.txt file also and it is on file is ready for archiving which means it has full read and write permission. This code bring out the same result i.e., it reads text file, displays each product part number from text file but only displays the values from database for last text file entry. I really do not understand what is the problem. Any more suggestions please.