FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Reading a file on same server
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Reading a file on same server [message #182362] Wed, 31 July 2013 11:13 Go to previous message
Bruce Lee is currently offline  Bruce Lee
Messages: 2
Registered: July 2013
Karma:
Junior Member
HI

Suppose I have a php file "read_file.php" that is used to read .txt files, the structure of the folder/files are:

/www/read_file.php
/www/public/upload/

I was wondering which will be faster and why in PHP..

Method 1:
read file using relative path

Eg: get_file_contents("public/upload/test.txt");


Method 2:
read file using URL (note that the server which is making the request and the server where the file is being read is same)

Eg: get_file_contents("http://mydomain.com/public/upload/test.txt");


Can someone explain me which is faster and why?


Thanks
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Why type hint when you can type cast
Next Topic: Newline (cr/lf) in imagestring
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Sep 20 13:24:44 GMT 2024

Total time taken to generate the page: 0.07407 seconds