What in the name of god is happening?!

this is my code:


$r=file("http://serverX/dir/txtfile.txt");
 
 foreach($r as $value){
 echo $value;
 
 }

after the file is loaded… this happen:

the url is: http://www.something.etc/file.php

after finish loading the file… it load, I don’t know why:

the url is: http://www.something.etc/file

404 - error… I don’t know why the same page is called without the .php extension!!

HEELLP