Accessing a file with contents

Bertel Lund Hansen nospamius at lundhansen.dk
Sun Sep 7 03:49:51 EDT 2003


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




More information about the Python-list mailing list