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
Re: Reading a file on same server [message #182366 is a reply to message #182362] Wed, 31 July 2013 13:13 Go to previous messageGo to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
Bruce Lee wrote:
^^^^^^^^^
Doubtful. Bruce Lee would have known the answer, having instructed Chuck
Norris who, as we all know, can write 100 LOCs of PHP with one finger in
less than one minute.

> 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?

Yes. But if you thought harder about what needs to happen in each case to
get the file contents (i.e., do your own homework), you could have explained
it yourself. That said, you could have just measured it:

<http://php.net/microtime>


PointedEars
--
When all you know is jQuery, every problem looks $(olvable).
[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 Nov 22 16:14:27 GMT 2024

Total time taken to generate the page: 0.03910 seconds