Accessing a file with contents

Discussion in 'Python' started by Bertel Lund Hansen, Sep 7, 2003.

  1. Hi all

    I have made some pages where PHP produces a menu and gets the
    contents from separate files. It works okay. But something I read
    made me wonder if there smarter ways to access the content file.

    At present I use include($content). Now I realize that this means
    that the conten file is PHP-parsed. I use that in some cases so I
    probably won't change it.

    If however I only needed to get the text and send it directly to
    the browser, is it true then that just I can use

    <? readfile($contents); ?>

    or

    <? file($contents);
    some_smart_way_of_printing_an_array();
    ?>

    Can I trust that readfile() will send the contents to the browser
    without a specific print() command?

    I read a note about the new version of file_get_contents() not
    being very fast (since it got binarysafe). Do others agree with
    this?

    I did not see any particular difference in speed when I tried
    readfile() instead of include(). Does it matter?

    --
    Bertel, Denmark
     
    Bertel Lund Hansen, Sep 7, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Don Adams
    Replies:
    1
    Views:
    600
    Martin Honnen
    Mar 5, 2004
  2. Replies:
    3
    Views:
    302
    Walter Roberson
    Jan 10, 2006
  3. Replies:
    0
    Views:
    269
  4. Kamarulnizam Rahim
    Replies:
    4
    Views:
    220
    Robert Klemme
    Jan 28, 2011
  5. Replies:
    0
    Views:
    195
Loading...

Share This Page