473,493 Members | 2,265 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Accessing a file with contents

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
Jul 18 '05 #1
0 1096

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3568
by: Generic Usenet Account | last post by:
I am trying to create a Java application that reads a list of URLs from a file and stores their contents on the local file system. I have succeeded in accessing normal websites, but I am unable to...
4
3737
by: Khalique | last post by:
I have built a web service whose purpose is to copy files from a secure place to client machine and vice versa. The problem I am having is perhaps related to permissions and access rights. For...
3
2331
by: nkrisraj | last post by:
Hi, I have a following structure: typedef struct { RateData rdr; int RateID; char RateBalance; } RateInfo;
8
3004
by: nkrisraj | last post by:
Hi, I have a following structure: typedef struct { RateData rdr; int RateID; char RateBalance; } RateInfo;
0
12048
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the...
5
2380
by: Andy | last post by:
I'm having trouble accessing an unmanaged long from a managed class in VC++.NET When I do, the contents of the variable seem to be mangled. If I access the same variable byte-by-byte, I get the...
5
1611
by: keirnna | last post by:
I am trying to access a file with perl and use substitution on that files contents and print the result of that substitution. I also need the the file I am accessing to be input on the command...
1
1440
by: Jerim79 | last post by:
Probably an incredibly simple answer, but I can't seem to phrase it so a search engine can understand it. I have a php script with a simple include: include("/include_this.php") I need to...
3
1448
by: FerrisUML | last post by:
Im writing a small web application and what I'd like to do is open a file, read the contents into memory and then close the file as fast as I can to free up the file for the next user. Once the...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7195
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6873
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7367
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5453
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1400
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.